From 4d792d0e459ba2667dbbbcff051b7abcddc37b46 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:16:14 +0100 Subject: [PATCH] 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 --- .../ROOT/pages/web/webflux/config.adoc | 1 - .../webmvc/mvc-config/message-converters.adoc | 1 - .../format/annotation/DateTimeFormat.java | 9 ++--- .../format/datetime/DateFormatter.java | 1 - .../standard/DateTimeFormatterFactory.java | 10 ++--- .../standard/DateTimeFormatterUtils.java | 4 +- .../DefaultFormattingConversionService.java | 4 +- ...ormattingConversionServiceFactoryBean.java | 19 ++++------ .../jdbc/support/JdbcUtils.java | 4 +- .../json/Jackson2ObjectMapperBuilder.java | 38 +++++++++---------- .../json/Jackson2ObjectMapperFactoryBean.java | 14 +++---- .../MessageBrokerBeanDefinitionParser.java | 4 +- ...cketMessageBrokerConfigurationSupport.java | 2 +- .../frame/Jackson2SockJsMessageCodec.java | 5 +-- 14 files changed, 49 insertions(+), 67 deletions(-) diff --git a/framework-docs/modules/ROOT/pages/web/webflux/config.adoc b/framework-docs/modules/ROOT/pages/web/webflux/config.adoc index 86d3ed91c2b..bef72ec172b 100644 --- a/framework-docs/modules/ROOT/pages/web/webflux/config.adoc +++ b/framework-docs/modules/ROOT/pages/web/webflux/config.adoc @@ -356,7 +356,6 @@ which customizes Jackson's default properties with the following ones: It also automatically registers the following well-known modules if they are detected on the classpath: -* {jackson-github-org}/jackson-datatype-joda[`jackson-datatype-joda`]: Support for Joda-Time types. * {jackson-github-org}/jackson-datatype-jsr310[`jackson-datatype-jsr310`]: Support for Java 8 Date and Time API types. * {jackson-github-org}/jackson-datatype-jdk8[`jackson-datatype-jdk8`]: Support for other Java 8 types, such as `Optional`. * {jackson-github-org}/jackson-module-kotlin[`jackson-module-kotlin`]: Support for Kotlin classes and data classes. diff --git a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/message-converters.adoc b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/message-converters.adoc index fb1abadc4ac..b1a0064bef5 100644 --- a/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/message-converters.adoc +++ b/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config/message-converters.adoc @@ -73,7 +73,6 @@ This builder customizes Jackson's default properties as follows: It also automatically registers the following well-known modules if they are detected on the classpath: -* {jackson-github-org}/jackson-datatype-joda[jackson-datatype-joda]: Support for Joda-Time types. * {jackson-github-org}/jackson-datatype-jsr310[jackson-datatype-jsr310]: Support for Java 8 Date and Time API types. * {jackson-github-org}/jackson-datatype-jdk8[jackson-datatype-jdk8]: Support for other Java 8 types, such as `Optional`. * {jackson-github-org}/jackson-module-kotlin[`jackson-module-kotlin`]: Support for Kotlin classes and data classes. diff --git a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java index f8a63e64fec..39fc7ba929f 100644 --- a/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java +++ b/spring-context/src/main/java/org/springframework/format/annotation/DateTimeFormat.java @@ -101,13 +101,13 @@ public @interface DateTimeFormat { /** * The custom pattern to use to format the field or method parameter. - *
Defaults to empty String, indicating no custom pattern String has been + *
Defaults to an empty String, indicating no custom pattern String has been * specified. Set this attribute when you wish to format your field or method * parameter in accordance with a custom date time pattern not represented by * a style or ISO format. - *
Note: This pattern follows the original {@link java.text.SimpleDateFormat} style, - * as also supported by Joda-Time, with strict parsing semantics towards overflows - * (e.g. rejecting a Feb 29 value for a non-leap-year). As a consequence, 'yy' + *
Note: This pattern follows the original {@link java.text.SimpleDateFormat} + * style, with strict parsing semantics towards overflows (for example, rejecting + * a {@code Feb 29} value for a non-leap-year). As a consequence, 'yy' * characters indicate a year in the traditional style, not a "year-of-era" as in the * {@link java.time.format.DateTimeFormatter} specification (i.e. 'yy' turns into 'uu' * when going through a {@code DateTimeFormatter} with strict resolution mode). @@ -129,7 +129,6 @@ public @interface DateTimeFormat { * or {@link #style} attribute is always used for printing. For details on * which time zone is used for fallback patterns, see the * {@linkplain DateTimeFormat class-level documentation}. - *
Fallback patterns are not supported for Joda-Time value types.
* @since 5.3.5
*/
String[] fallbackPatterns() default {};
diff --git a/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java b/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java
index 0d6bde41743..ff6a5cce22a 100644
--- a/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java
+++ b/spring-context/src/main/java/org/springframework/format/datetime/DateFormatter.java
@@ -181,7 +181,6 @@ public class DateFormatter implements Formatter The first character is used for the date style; the second is for
* the time style. Supported characters are:
* This method mimics the styles supported by Joda-Time. Note that
- * JSR-310 natively favors {@link java.time.format.FormatStyle} as used for
- * {@link #setDateStyle}, {@link #setTimeStyle} and {@link #setDateTimeStyle}.
+ * Note that JSR-310 natively favors {@link java.time.format.FormatStyle}
+ * as used for {@link #setDateStyle}, {@link #setTimeStyle}, and
+ * {@link #setDateTimeStyle}.
* @param style two characters from the set {"S", "M", "L", "F", "-"}
*/
public void setStylePattern(String style) {
diff --git a/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterUtils.java b/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterUtils.java
index 3aff5d779dd..6317b8208a7 100644
--- a/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterUtils.java
+++ b/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterUtils.java
@@ -38,8 +38,8 @@ abstract class DateTimeFormatterUtils {
* @see ResolverStyle#STRICT
*/
static DateTimeFormatter createStrictDateTimeFormatter(String pattern) {
- // Using strict resolution to align with Joda-Time and standard DateFormat behavior:
- // otherwise, an overflow like e.g. Feb 29 for a non-leap-year wouldn't get rejected.
+ // Using strict resolution to align with standard DateFormat behavior:
+ // otherwise, an overflow like, for example, Feb 29 for a non-leap-year wouldn't get rejected.
// However, with strict resolution, a year digit needs to be specified as 'u'...
String patternToUse = StringUtils.replace(pattern, "yy", "uu");
return DateTimeFormatter.ofPattern(patternToUse).withResolverStyle(ResolverStyle.STRICT);
diff --git a/spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java b/spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java
index aa3ecdbdbd6..b3bd23631f5 100644
--- a/spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java
+++ b/spring-context/src/main/java/org/springframework/format/support/DefaultFormattingConversionService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -97,7 +97,7 @@ public class DefaultFormattingConversionService extends FormattingConversionServ
/**
* Add formatters appropriate for most environments: including number formatters,
- * JSR-354 Money & Currency formatters, JSR-310 Date-Time and/or Joda-Time formatters,
+ * JSR-354 Money & Currency formatters, and JSR-310 Date-Time formatters,
* depending on the presence of the corresponding API on the classpath.
* @param formatterRegistry the service to register default formatters with
*/
diff --git a/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java b/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java
index 4ac53b00911..c4e0ca1a278 100644
--- a/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java
+++ b/spring-context/src/main/java/org/springframework/format/support/FormattingConversionServiceFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2023 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,24 +32,19 @@ import org.springframework.lang.Nullable;
import org.springframework.util.StringValueResolver;
/**
- * A factory providing convenient access to a {@code FormattingConversionService}
- * configured with converters and formatters for common types such as numbers and
- * datetimes.
+ * A factory providing convenient access to a {@link FormattingConversionService}
+ * configured with converters and formatters for common types such as numbers, dates,
+ * and times.
*
* Additional converters and formatters can be registered declaratively through
* {@link #setConverters(Set)} and {@link #setFormatters(Set)}. Another option
* is to register converters and formatters in code by implementing the
- * {@link FormatterRegistrar} interface. You can then configure provide the set
- * of registrars to use through {@link #setFormatterRegistrars(Set)}.
- *
- * A good example for registering converters and formatters in code is
- * {@code JodaTimeFormatterRegistrar}, which registers a number of
- * date-related formatters and converters. For a more detailed list of cases
- * see {@link #setFormatterRegistrars(Set)}
+ * {@link FormatterRegistrar} interface. You can then provide the set of registrars
+ * to use through {@link #setFormatterRegistrars(Set)}.
*
* Like all {@code FactoryBean} implementations, this class is suitable for
* use when configuring a Spring application context using Spring {@code Default value used is {@link Locale#getDefault()}.
* @since 4.1.5
*/
public Jackson2ObjectMapperBuilder locale(Locale locale) {
@@ -224,7 +224,7 @@ public class Jackson2ObjectMapperBuilder {
/**
* Override the default {@link Locale} to use for formatting.
- * Default value used is {@link Locale#getDefault()}.
+ * Default value used is {@link Locale#getDefault()}.
* @param localeString the locale ID as a String representation
* @since 4.1.5
*/
@@ -235,7 +235,7 @@ public class Jackson2ObjectMapperBuilder {
/**
* Override the default {@link TimeZone} to use for formatting.
- * Default value used is UTC (NOT local timezone).
+ * Default value used is UTC (NOT local timezone).
* @since 4.1.5
*/
public Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) {
@@ -245,7 +245,7 @@ public class Jackson2ObjectMapperBuilder {
/**
* Override the default {@link TimeZone} to use for formatting.
- * Default value used is UTC (NOT local timezone).
+ * Default value used is UTC (NOT local timezone).
* @param timeZoneString the zone ID as a String representation
* @since 4.1.5
*/
@@ -265,7 +265,7 @@ public class Jackson2ObjectMapperBuilder {
/**
* Alternative to {@link #annotationIntrospector(AnnotationIntrospector)}
* that allows combining with rather than replacing the currently set
- * introspector, e.g. via
+ * introspector — for example, via
* {@link AnnotationIntrospectorPair#pair(AnnotationIntrospector, AnnotationIntrospector)}.
* @param pairingFunction a function to apply to the currently set
* introspector (possibly {@code null}); the result of the function becomes
@@ -525,10 +525,10 @@ public class Jackson2ObjectMapperBuilder {
/**
* Specify the modules to be registered with the {@link ObjectMapper}.
- * Multiple invocations are not additive, the last one defines the modules to
+ * Multiple invocations are not additive; the last one defines the modules to
* register.
- * Note: If this is set, no finding of modules is going to happen - not by
- * Jackson, and not by Spring either (see {@link #findModulesViaServiceLoader}).
+ * Note: If this is set, autodetection of modules will not occur — not
+ * by Jackson, and not by Spring either (see {@link #findModulesViaServiceLoader}).
* As a consequence, specifying an empty list here will suppress any kind of
* module detection.
* Specify either this or {@link #modulesToInstall}, not both.
@@ -571,11 +571,10 @@ public class Jackson2ObjectMapperBuilder {
/**
* Specify one or more modules to be registered with the {@link ObjectMapper}.
- * Multiple invocations are not additive, the last one defines the modules
+ * Multiple invocations are not additive; the last one defines the modules
* to register.
- * Modules specified here will be registered after
- * Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
- * finding of modules (see {@link #findModulesViaServiceLoader}),
+ * Modules specified here will be registered after Spring's autodetection of
+ * JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
* allowing to eventually override their configuration.
* Specify either this or {@link #modules(Module...)}, not both.
* @since 4.1.5
@@ -605,13 +604,11 @@ public class Jackson2ObjectMapperBuilder {
}
/**
- * Specify one or more modules by class to be registered with
- * the {@link ObjectMapper}.
- * Multiple invocations are not additive, the last one defines the modules
+ * Specify one or more modules by class to be registered with the {@link ObjectMapper}.
+ * Multiple invocations are not additive; the last one defines the modules
* to register.
- * Modules specified here will be registered after
- * Spring's autodetection of JSR-310 and Joda-Time, or Jackson's
- * finding of modules (see {@link #findModulesViaServiceLoader}),
+ * Modules specified here will be registered after Spring's autodetection of
+ * JSR-310, or Jackson's finding of modules (see {@link #findModulesViaServiceLoader}),
* allowing to eventually override their configuration.
* Specify either this or {@link #modules(Module...)}, not both.
* @see #modulesToInstall(Module...)
@@ -630,8 +627,7 @@ public class Jackson2ObjectMapperBuilder {
* Set whether to let Jackson find available modules via the JDK ServiceLoader,
* based on META-INF metadata in the classpath.
* If this mode is not set, Spring's Jackson2ObjectMapperBuilder itself
- * will try to find the JSR-310 and Joda-Time support modules on the classpath -
- * provided that Java 8 and Joda-Time themselves are available, respectively.
+ * will try to find the JSR-310 support module on the classpath.
* @see com.fasterxml.jackson.databind.ObjectMapper#findModules()
*/
public Jackson2ObjectMapperBuilder findModulesViaServiceLoader(boolean findModules) {
diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java
index 83c1e5b2237..63b5f3f13c6 100644
--- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java
+++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2022 the original author or authors.
+ * Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -391,11 +391,10 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean Modules specified here will be registered after Spring's autodetection of
+ * JSR-310, or Jackson's finding of modules (see {@link #setFindModulesViaServiceLoader}),
* allowing to eventually override their configuration.
* Specify either this or {@link #setModules}, not both.
* @since 4.0.1
@@ -410,8 +409,7 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
- * when available (and when Java 8 and Joda-Time themselves are available, respectively).
- *
* @author Rossen Stoyanchev
* @since 4.0
*/
@@ -126,9 +126,9 @@ public class DateTimeFormatterFactory {
*
- *