diff --git a/framework-docs/modules/ROOT/pages/web/webflux/config.adoc b/framework-docs/modules/ROOT/pages/web/webflux/config.adoc index 86d3ed91c2bd..bef72ec172b2 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 fb1abadc4aca..b1a0064bef5c 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 f8a63e64fec7..39fc7ba929f1 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 @@ /** * 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 @@ * 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 0d6bde41743c..ff6a5cce22a2 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 void setStyle(int style) { *

  • 'F' = Full
  • *
  • '-' = Omitted
  • * - * This method mimics the styles supported by Joda-Time. * @param stylePattern two characters from the set {"S", "M", "L", "F", "-"} * @since 3.2 */ diff --git a/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.java b/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.java index 3d0f395a0846..f58b7d602101 100644 --- a/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.java +++ b/spring-context/src/main/java/org/springframework/format/datetime/standard/DateTimeFormatterFactory.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. @@ -116,7 +116,7 @@ public void setDateTimeStyle(FormatStyle dateTimeStyle) { } /** - * Set the two characters to use to format date values, in Joda-Time style. + * Set the two characters to use to format date values. *

    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 3aff5d779dd2..6317b8208a7a 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 aa3ecdbdbd68..b3bd23631f52 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 DefaultFormattingConversionService( /** * 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 4ac53b009112..c4e0ca1a2787 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.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 } - * XML. When configuring the container with + * XML configuration files. When configuring the container with * {@link org.springframework.context.annotation.Configuration @Configuration} * classes, simply instantiate, configure and return the appropriate * {@code FormattingConversionService} object from a diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java index 185e210a86ec..b12ddc0a63f9 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java @@ -239,8 +239,8 @@ else if (obj instanceof Number number) { } } - // Corresponding SQL types for JSR-310 / Joda-Time types, left up - // to the caller to convert them (e.g. through a ConversionService). + // Corresponding SQL types for JSR-310, left up to the caller to convert + // them (for example, through a ConversionService). String typeName = requiredType.getSimpleName(); return switch (typeName) { case "LocalDate" -> rs.getDate(index); diff --git a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java index a9f101c915f6..669ef837f9be 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.java +++ b/spring-web/src/main/java/org/springframework/http/converter/json/Jackson2ObjectMapperBuilder.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. @@ -214,7 +214,7 @@ public Jackson2ObjectMapperBuilder simpleDateFormat(String format) { /** * Override the default {@link Locale} to use for formatting. - * Default value used is {@link Locale#getDefault()}. + *

    Default value used is {@link Locale#getDefault()}. * @since 4.1.5 */ public Jackson2ObjectMapperBuilder locale(Locale locale) { @@ -224,7 +224,7 @@ public Jackson2ObjectMapperBuilder locale(Locale locale) { /** * 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 Jackson2ObjectMapperBuilder locale(String localeString) { /** * 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 Jackson2ObjectMapperBuilder timeZone(TimeZone timeZone) { /** * 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 Jackson2ObjectMapperBuilder annotationIntrospector(AnnotationIntrospector /** * 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 Jackson2ObjectMapperBuilder featuresToDisable(Object... featuresToDisable /** * 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 Jackson2ObjectMapperBuilder modules(Consumer> consumer) { /** * 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 Jackson2ObjectMapperBuilder modulesToInstall(Consumer> consu } /** - * 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 final Jackson2ObjectMapperBuilder modulesToInstall(ClassIf 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 83c1e5b22379..63b5f3f13c6d 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 void setModules(List modules) { } /** - * Specify one or more modules by class (or class name in XML) - * to be registered with the {@link ObjectMapper}. - *

    Modules specified here will be registered after - * Spring's autodetection of JSR-310 and Joda-Time, or Jackson's - * finding of modules (see {@link #setFindModulesViaServiceLoader}), + * Specify one or more modules by class (or class name in XML) to be registered + * with the {@link ObjectMapper}. + *

    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 final void setModulesToInstall(Class... modules) { * 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 Jackson2ObjectMapperFactoryBean 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. * @since 4.0.1 * @see com.fasterxml.jackson.databind.ObjectMapper#findModules() */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java index 78835e0c79c8..ca5ae76f1407 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 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. @@ -511,7 +511,7 @@ private RuntimeBeanReference registerMessageConverter( RootBeanDefinition resolverDef = new RootBeanDefinition(DefaultContentTypeResolver.class); resolverDef.getPropertyValues().add("defaultMimeType", MimeTypeUtils.APPLICATION_JSON); jacksonConverterDef.getPropertyValues().add("contentTypeResolver", resolverDef); - // Use Jackson factory in order to have JSR-310 and Joda-Time modules registered automatically + // Use Jackson factory in order to have well known modules registered automatically GenericBeanDefinition jacksonFactoryDef = new GenericBeanDefinition(); jacksonFactoryDef.setBeanClass(Jackson2ObjectMapperFactoryBean.class); jacksonFactoryDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java index a3cd5f1c78b9..9ee00efa8328 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupport.java @@ -165,7 +165,7 @@ public WebSocketMessageBrokerStats webSocketMessageBrokerStats( @Override protected MappingJackson2MessageConverter createJacksonConverter() { MappingJackson2MessageConverter messageConverter = super.createJacksonConverter(); - // Use Jackson builder in order to have JSR-310 and Joda-Time modules registered automatically + // Use Jackson builder in order to have well-known modules registered automatically. Jackson2ObjectMapperBuilder builder = Jackson2ObjectMapperBuilder.json(); ApplicationContext applicationContext = getApplicationContext(); if (applicationContext != null) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java index d6699ccf94e4..e76503ea2368 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/Jackson2SockJsMessageCodec.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. @@ -37,9 +37,6 @@ *

  • {@link DeserializationFeature#FAIL_ON_UNKNOWN_PROPERTIES} is disabled
  • * * - *

    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 */