Skip to content

Commit d92c57f

Browse files
committed
Merge branch '6.1.x'
2 parents 4ca596b + 4d792d0 commit d92c57f

File tree

14 files changed

+46
-64
lines changed

14 files changed

+46
-64
lines changed

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

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

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

352-
* {jackson-github-org}/jackson-datatype-joda[`jackson-datatype-joda`]: Support for Joda-Time types.
353352
* {jackson-github-org}/jackson-datatype-jsr310[`jackson-datatype-jsr310`]: Support for Java 8 Date and Time API types.
354353
* {jackson-github-org}/jackson-datatype-jdk8[`jackson-datatype-jdk8`]: Support for other Java 8 types, such as `Optional`.
355354
* {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
@@ -35,7 +35,6 @@ This builder customizes Jackson's default properties as follows:
3535

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

38-
* {jackson-github-org}/jackson-datatype-joda[jackson-datatype-joda]: Support for Joda-Time types.
3938
* {jackson-github-org}/jackson-datatype-jsr310[jackson-datatype-jsr310]: Support for Java 8 Date and Time API types.
4039
* {jackson-github-org}/jackson-datatype-jdk8[jackson-datatype-jdk8]: Support for other Java 8 types, such as `Optional`.
4140
* {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-
* (for example, 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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ 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:
41+
// Using strict resolution to align with standard DateFormat behavior:
4242
// 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");

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 (for example, 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

+15-19
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public Jackson2ObjectMapperBuilder simpleDateFormat(String format) {
216216

217217
/**
218218
* Override the default {@link Locale} to use for formatting.
219-
* Default value used is {@link Locale#getDefault()}.
219+
* <p>Default value used is {@link Locale#getDefault()}.
220220
* @since 4.1.5
221221
*/
222222
public Jackson2ObjectMapperBuilder locale(Locale locale) {
@@ -226,7 +226,7 @@ public Jackson2ObjectMapperBuilder locale(Locale locale) {
226226

227227
/**
228228
* Override the default {@link Locale} to use for formatting.
229-
* Default value used is {@link Locale#getDefault()}.
229+
* <p>Default value used is {@link Locale#getDefault()}.
230230
* @param localeString the locale ID as a String representation
231231
* @since 4.1.5
232232
*/
@@ -237,7 +237,7 @@ public Jackson2ObjectMapperBuilder locale(String localeString) {
237237

238238
/**
239239
* Override the default {@link TimeZone} to use for formatting.
240-
* Default value used is UTC (NOT local timezone).
240+
* <p>Default value used is UTC (NOT local timezone).
241241
* @since 4.1.5
242242
*/
243243
public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) {
@@ -247,7 +247,7 @@ public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) {
247247

248248
/**
249249
* Override the default {@link TimeZone} to use for formatting.
250-
* Default value used is UTC (NOT local timezone).
250+
* <p>Default value used is UTC (NOT local timezone).
251251
* @param timeZoneString the zone ID as a String representation
252252
* @since 4.1.5
253253
*/
@@ -527,10 +527,10 @@ public Jackson2ObjectMapperBuilder featuresToDisable(Object... featuresToDisable
527527

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

574574
/**
575575
* Specify one or more modules to be registered with the {@link ObjectMapper}.
576-
* <p>Multiple invocations are not additive, the last one defines the modules
576+
* <p>Multiple invocations are not additive; the last one defines the modules
577577
* to register.
578-
* <p>Modules specified here will be registered after
579-
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
580-
* finding of modules (see {@link #findModulesViaServiceLoader}),
578+
* <p>Modules specified here will be registered after Spring's autodetection of
579+
* JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
581580
* allowing to eventually override their configuration.
582581
* <p>Specify either this or {@link #modules(Module...)}, not both.
583582
* @since 4.1.5
@@ -607,13 +606,11 @@ public Jackson2ObjectMapperBuilder modulesToInstall(Consumer<List<Module>> consu
607606
}
608607

609608
/**
610-
* Specify one or more modules by class to be registered with
611-
* the {@link ObjectMapper}.
612-
* <p>Multiple invocations are not additive, the last one defines the modules
609+
* Specify one or more modules by class to be registered with the {@link ObjectMapper}.
610+
* <p>Multiple invocations are not additive; the last one defines the modules
613611
* to register.
614-
* <p>Modules specified here will be registered after
615-
* Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
616-
* finding of modules (see {@link #findModulesViaServiceLoader}),
612+
* <p>Modules specified here will be registered after Spring's autodetection of
613+
* JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
617614
* allowing to eventually override their configuration.
618615
* <p>Specify either this or {@link #modules(Module...)}, not both.
619616
* @see #modulesToInstall(Module...)
@@ -632,8 +629,7 @@ public final Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module
632629
* Set whether to let Jackson find available modules via the JDK ServiceLoader,
633630
* based on META-INF metadata in the classpath.
634631
* <p>If this mode is not set, Spring's Jackson2ObjectMapperBuilder itself
635-
* will try to find the JSR-310 and Joda-Time support modules on the classpath -
636-
* provided that Java 8 and Joda-Time themselves are available, respectively.
632+
* will try to find the JSR-310 support module on the classpath.
637633
* @see com.fasterxml.jackson.databind.ObjectMapper#findModules()
638634
*/
639635
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)