Skip to content

Commit 4d792d0

Browse files
committed
Remove mentions of Joda-Time support
Since Joda-Time support was removed in Spring Framework 6.0, this commit removes obsolete mentions of Joda-Time in the reference guide and Javadoc. See gh-27426 Closes gh-33881
1 parent 0a5bd89 commit 4d792d0

File tree

14 files changed

+49
-67
lines changed

14 files changed

+49
-67
lines changed

framework-docs/modules/ROOT/pages/web/webflux/config.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ which customizes Jackson's default properties with the following ones:
356356

357357
It also automatically registers the following well-known modules if they are detected on the classpath:
358358

359-
* {jackson-github-org}/jackson-datatype-joda[`jackson-datatype-joda`]: Support for Joda-Time types.
360359
* {jackson-github-org}/jackson-datatype-jsr310[`jackson-datatype-jsr310`]: Support for Java 8 Date and Time API types.
361360
* {jackson-github-org}/jackson-datatype-jdk8[`jackson-datatype-jdk8`]: Support for other Java 8 types, such as `Optional`.
362361
* {jackson-github-org}/jackson-module-kotlin[`jackson-module-kotlin`]: Support for Kotlin classes and data classes.

framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/message-converters.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ This builder customizes Jackson's default properties as follows:
7373

7474
It also automatically registers the following well-known modules if they are detected on the classpath:
7575

76-
* {jackson-github-org}/jackson-datatype-joda[jackson-datatype-joda]: Support for Joda-Time types.
7776
* {jackson-github-org}/jackson-datatype-jsr310[jackson-datatype-jsr310]: Support for Java 8 Date and Time API types.
7877
* {jackson-github-org}/jackson-datatype-jdk8[jackson-datatype-jdk8]: Support for other Java 8 types, such as `Optional`.
7978
* {jackson-github-org}/jackson-module-kotlin[`jackson-module-kotlin`]: Support for Kotlin classes and data classes.

spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@
101101

102102
/**
103103
* The custom pattern to use to format the field or method parameter.
104-
* <p>Defaults to empty String, indicating no custom pattern String has been
104+
* <p>Defaults to an empty String, indicating no custom pattern String has been
105105
* specified. Set this attribute when you wish to format your field or method
106106
* parameter in accordance with a custom date time pattern not represented by
107107
* a style or ISO format.
108-
* <p>Note: This pattern follows the original {@link java.text.SimpleDateFormat} style,
109-
* as also supported by Joda-Time, with strict parsing semantics towards overflows
110-
* (e.g. rejecting a Feb 29 value for a non-leap-year). As a consequence, 'yy'
108+
* <p>Note: This pattern follows the original {@link java.text.SimpleDateFormat}
109+
* style, with strict parsing semantics towards overflows (for example, rejecting
110+
* a {@code Feb 29} value for a non-leap-year). As a consequence, 'yy'
111111
* characters indicate a year in the traditional style, not a "year-of-era" as in the
112112
* {@link java.time.format.DateTimeFormatter} specification (i.e. 'yy' turns into 'uu'
113113
* when going through a {@code DateTimeFormatter} with strict resolution mode).
@@ -129,7 +129,6 @@
129129
* or {@link #style} attribute is always used for printing. For details on
130130
* which time zone is used for fallback patterns, see the
131131
* {@linkplain DateTimeFormat class-level documentation}.
132-
* <p>Fallback patterns are not supported for Joda-Time value types.
133132
* @since 5.3.5
134133
*/
135134
String[] fallbackPatterns() default {};

spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ public void setStyle(int style) {
181181
* <li>'F' = Full</li>
182182
* <li>'-' = Omitted</li>
183183
* </ul>
184-
* This method mimics the styles supported by Joda-Time.
185184
* @param stylePattern two characters from the set {"S", "M", "L", "F", "-"}
186185
* @since 3.2
187186
*/

spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -116,7 +116,7 @@ public void setDateTimeStyle(FormatStyle dateTimeStyle) {
116116
}
117117

118118
/**
119-
* Set the two characters to use to format date values, in Joda-Time style.
119+
* Set the two characters to use to format date values.
120120
* <p>The first character is used for the date style; the second is for
121121
* the time style. Supported characters are:
122122
* <ul>
@@ -126,9 +126,9 @@ public void setDateTimeStyle(FormatStyle dateTimeStyle) {
126126
* <li>'F' = Full</li>
127127
* <li>'-' = Omitted</li>
128128
* </ul>
129-
* <p>This method mimics the styles supported by Joda-Time. Note that
130-
* JSR-310 natively favors {@link java.time.format.FormatStyle} as used for
131-
* {@link #setDateStyle}, {@link #setTimeStyle} and {@link #setDateTimeStyle}.
129+
* <p>Note that JSR-310 natively favors {@link java.time.format.FormatStyle}
130+
* as used for {@link #setDateStyle}, {@link #setTimeStyle}, and
131+
* {@link #setDateTimeStyle}.
132132
* @param style two characters from the set {"S", "M", "L", "F", "-"}
133133
*/
134134
public void setStylePattern(String style) {

spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ abstract class DateTimeFormatterUtils {
3838
* @see ResolverStyle#STRICT
3939
*/
4040
static DateTimeFormatter createStrictDateTimeFormatter(String pattern) {
41-
// Using strict resolution to align with Joda-Time and standard DateFormat behavior:
42-
// otherwise, an overflow like e.g. Feb 29 for a non-leap-year wouldn't get rejected.
41+
// Using strict resolution to align with standard DateFormat behavior:
42+
// otherwise, an overflow like, for example, Feb 29 for a non-leap-year wouldn't get rejected.
4343
// However, with strict resolution, a year digit needs to be specified as 'u'...
4444
String patternToUse = StringUtils.replace(pattern, "yy", "uu");
4545
return DateTimeFormatter.ofPattern(patternToUse).withResolverStyle(ResolverStyle.STRICT);

spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ public DefaultFormattingConversionService(
9797

9898
/**
9999
* Add formatters appropriate for most environments: including number formatters,
100-
* JSR-354 Money &amp; Currency formatters, JSR-310 Date-Time and/or Joda-Time formatters,
100+
* JSR-354 Money &amp; Currency formatters, and JSR-310 Date-Time formatters,
101101
* depending on the presence of the corresponding API on the classpath.
102102
* @param formatterRegistry the service to register default formatters with
103103
*/

spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -32,24 +32,19 @@
3232
import org.springframework.util.StringValueResolver;
3333

3434
/**
35-
* A factory providing convenient access to a {@code FormattingConversionService}
36-
* configured with converters and formatters for common types such as numbers and
37-
* datetimes.
35+
* A factory providing convenient access to a {@link FormattingConversionService}
36+
* configured with converters and formatters for common types such as numbers, dates,
37+
* and times.
3838
*
3939
* <p>Additional converters and formatters can be registered declaratively through
4040
* {@link #setConverters(Set)} and {@link #setFormatters(Set)}. Another option
4141
* is to register converters and formatters in code by implementing the
42-
* {@link FormatterRegistrar} interface. You can then configure provide the set
43-
* of registrars to use through {@link #setFormatterRegistrars(Set)}.
44-
*
45-
* <p>A good example for registering converters and formatters in code is
46-
* {@code JodaTimeFormatterRegistrar}, which registers a number of
47-
* date-related formatters and converters. For a more detailed list of cases
48-
* see {@link #setFormatterRegistrars(Set)}
42+
* {@link FormatterRegistrar} interface. You can then provide the set of registrars
43+
* to use through {@link #setFormatterRegistrars(Set)}.
4944
*
5045
* <p>Like all {@code FactoryBean} implementations, this class is suitable for
5146
* use when configuring a Spring application context using Spring {@code <beans>}
52-
* XML. When configuring the container with
47+
* XML configuration files. When configuring the container with
5348
* {@link org.springframework.context.annotation.Configuration @Configuration}
5449
* classes, simply instantiate, configure and return the appropriate
5550
* {@code FormattingConversionService} object from a

spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ else if (obj instanceof Number number) {
239239
}
240240
}
241241

242-
// Corresponding SQL types for JSR-310 / Joda-Time types, left up
243-
// to the caller to convert them (e.g. through a ConversionService).
242+
// Corresponding SQL types for JSR-310, left up to the caller to convert
243+
// them (for example, through a ConversionService).
244244
String typeName = requiredType.getSimpleName();
245245
return switch (typeName) {
246246
case "LocalDate" -> rs.getDate(index);

spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java

+17-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -214,7 +214,7 @@ public Jackson2ObjectMapperBuilder simpleDateFormat(String format) {
214214

215215
/**
216216
* Override the default {@link Locale} to use for formatting.
217-
* Default value used is {@link Locale#getDefault()}.
217+
* <p>Default value used is {@link Locale#getDefault()}.
218218
* @since 4.1.5
219219
*/
220220
public Jackson2ObjectMapperBuilder locale(Locale locale) {
@@ -224,7 +224,7 @@ public Jackson2ObjectMapperBuilder locale(Locale locale) {
224224

225225
/**
226226
* Override the default {@link Locale} to use for formatting.
227-
* Default value used is {@link Locale#getDefault()}.
227+
* <p>Default value used is {@link Locale#getDefault()}.
228228
* @param localeString the locale ID as a String representation
229229
* @since 4.1.5
230230
*/
@@ -235,7 +235,7 @@ public Jackson2ObjectMapperBuilder locale(String localeString) {
235235

236236
/**
237237
* Override the default {@link TimeZone} to use for formatting.
238-
* Default value used is UTC (NOT local timezone).
238+
* <p>Default value used is UTC (NOT local timezone).
239239
* @since 4.1.5
240240
*/
241241
public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) {
@@ -245,7 +245,7 @@ public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) {
245245

246246
/**
247247
* Override the default {@link TimeZone} to use for formatting.
248-
* Default value used is UTC (NOT local timezone).
248+
* <p>Default value used is UTC (NOT local timezone).
249249
* @param timeZoneString the zone ID as a String representation
250250
* @since 4.1.5
251251
*/
@@ -265,7 +265,7 @@ public Jackson2ObjectMapperBuilder annotationIntrospector(AnnotationIntrospector
265265
/**
266266
* Alternative to {@link #annotationIntrospector(AnnotationIntrospector)}
267267
* that allows combining with rather than replacing the currently set
268-
* introspector, e.g. via
268+
* introspector &mdash; for example, via
269269
* {@link AnnotationIntrospectorPair#pair(AnnotationIntrospector, AnnotationIntrospector)}.
270270
* @param pairingFunction a function to apply to the currently set
271271
* introspector (possibly {@code null}); the result of the function becomes
@@ -525,10 +525,10 @@ public Jackson2ObjectMapperBuilder featuresToDisable(Object... featuresToDisable
525525

526526
/**
527527
* Specify the modules to be registered with the {@link ObjectMapper}.
528-
* <p>Multiple invocations are not additive, the last one defines the modules to
528+
* <p>Multiple invocations are not additive; the last one defines the modules to
529529
* register.
530-
* <p>Note: If this is set, no finding of modules is going to happen - not by
531-
* Jackson, and not by Spring either (see {@link #findModulesViaServiceLoader}).
530+
* <p>Note: If this is set, autodetection of modules will not occur &mdash; not
531+
* by Jackson, and not by Spring either (see {@link #findModulesViaServiceLoader}).
532532
* As a consequence, specifying an empty list here will suppress any kind of
533533
* module detection.
534534
* <p>Specify either this or {@link #modulesToInstall}, not both.
@@ -571,11 +571,10 @@ public Jackson2ObjectMapperBuilder modules(Consumer<List<Module>> consumer) {
571571

572572
/**
573573
* Specify one or more modules to be registered with the {@link ObjectMapper}.
574-
* <p>Multiple invocations are not additive, the last one defines the modules
574+
* <p>Multiple invocations are not additive; the last one defines the modules
575575
* to register.
576-
* <p>Modules specified here will be registered after
577-
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
578-
* finding of modules (see {@link #findModulesViaServiceLoader}),
576+
* <p>Modules specified here will be registered after Spring's autodetection of
577+
* JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
579578
* allowing to eventually override their configuration.
580579
* <p>Specify either this or {@link #modules(Module...)}, not both.
581580
* @since 4.1.5
@@ -605,13 +604,11 @@ public Jackson2ObjectMapperBuilder modulesToInstall(Consumer<List<Module>> consu
605604
}
606605

607606
/**
608-
* Specify one or more modules by class to be registered with
609-
* the {@link ObjectMapper}.
610-
* <p>Multiple invocations are not additive, the last one defines the modules
607+
* Specify one or more modules by class to be registered with the {@link ObjectMapper}.
608+
* <p>Multiple invocations are not additive; the last one defines the modules
611609
* to register.
612-
* <p>Modules specified here will be registered after
613-
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
614-
* finding of modules (see {@link #findModulesViaServiceLoader}),
610+
* <p>Modules specified here will be registered after Spring's autodetection of
611+
* JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
615612
* allowing to eventually override their configuration.
616613
* <p>Specify either this or {@link #modules(Module...)}, not both.
617614
* @see #modulesToInstall(Module...)
@@ -630,8 +627,7 @@ public final Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module
630627
* Set whether to let Jackson find available modules via the JDK ServiceLoader,
631628
* based on META-INF metadata in the classpath.
632629
* <p>If this mode is not set, Spring's Jackson2ObjectMapperBuilder itself
633-
* will try to find the JSR-310 and Joda-Time support modules on the classpath -
634-
* provided that Java 8 and Joda-Time themselves are available, respectively.
630+
* will try to find the JSR-310 support module on the classpath.
635631
* @see com.fasterxml.jackson.databind.ObjectMapper#findModules()
636632
*/
637633
public Jackson2ObjectMapperBuilder findModulesViaServiceLoader(boolean findModules) {

spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -391,11 +391,10 @@ public void setModules(List<Module> modules) {
391391
}
392392

393393
/**
394-
* Specify one or more modules by class (or class name in XML)
395-
* to be registered with the {@link ObjectMapper}.
396-
* <p>Modules specified here will be registered after
397-
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
398-
* finding of modules (see {@link #setFindModulesViaServiceLoader}),
394+
* Specify one or more modules by class (or class name in XML) to be registered
395+
* with the {@link ObjectMapper}.
396+
* <p>Modules specified here will be registered after Spring's autodetection of
397+
* JSR-310, or Jackson's finding of modules (see {@link #setFindModulesViaServiceLoader}),
399398
* allowing to eventually override their configuration.
400399
* <p>Specify either this or {@link #setModules}, not both.
401400
* @since 4.0.1
@@ -410,8 +409,7 @@ public final void setModulesToInstall(Class<? extends Module>... modules) {
410409
* Set whether to let Jackson find available modules via the JDK ServiceLoader,
411410
* based on META-INF metadata in the classpath.
412411
* <p>If this mode is not set, Spring's Jackson2ObjectMapperFactoryBean itself
413-
* will try to find the JSR-310 and Joda-Time support modules on the classpath -
414-
* provided that Java 8 and Joda-Time themselves are available, respectively.
412+
* will try to find the JSR-310 support module on the classpath.
415413
* @since 4.0.1
416414
* @see com.fasterxml.jackson.databind.ObjectMapper#findModules()
417415
*/

spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -511,7 +511,7 @@ private RuntimeBeanReference registerMessageConverter(
511511
RootBeanDefinition resolverDef = new RootBeanDefinition(DefaultContentTypeResolver.class);
512512
resolverDef.getPropertyValues().add("defaultMimeType", MimeTypeUtils.APPLICATION_JSON);
513513
jacksonConverterDef.getPropertyValues().add("contentTypeResolver", resolverDef);
514-
// Use Jackson factory in order to have JSR-310 and Joda-Time modules registered automatically
514+
// Use Jackson factory in order to have well known modules registered automatically
515515
GenericBeanDefinition jacksonFactoryDef = new GenericBeanDefinition();
516516
jacksonFactoryDef.setBeanClass(Jackson2ObjectMapperFactoryBean.class);
517517
jacksonFactoryDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);

spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public WebSocketMessageBrokerStats webSocketMessageBrokerStats(
165165
@Override
166166
protected MappingJackson2MessageConverter createJacksonConverter() {
167167
MappingJackson2MessageConverter messageConverter = super.createJacksonConverter();
168-
// Use Jackson builder in order to have JSR-310 and Joda-Time modules registered automatically
168+
// Use Jackson builder in order to have well-known modules registered automatically.
169169
Jackson2ObjectMapperBuilder builder = Jackson2ObjectMapperBuilder.json();
170170
ApplicationContext applicationContext = getApplicationContext();
171171
if (applicationContext != null) {

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -37,9 +37,6 @@
3737
* <li>{@link DeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES} is disabled</li>
3838
* </ul>
3939
*
40-
* <p>Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
41-
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
42-
*
4340
* @author Rossen Stoyanchev
4441
* @since 4.0
4542
*/

0 commit comments

Comments
 (0)