diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml index 60923df61f7..1eebdbcdb78 100644 --- a/config/checkstyle/checkstyle-suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -29,6 +29,7 @@ + diff --git a/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java b/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java index fd04817c106..c8d11f22b80 100644 --- a/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java +++ b/core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionMessage.java @@ -442,7 +442,7 @@ public final class ConditionMessage { return result; } - protected abstract @Nullable Object applyToItem(@Nullable Object item); + abstract @Nullable Object applyToItem(@Nullable Object item); } diff --git a/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiElement.java b/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiElement.java index bd5e3b08b7a..fd6b9997045 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiElement.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiElement.java @@ -25,6 +25,7 @@ package org.springframework.boot.ansi; public interface AnsiElement { /** + * Return the ANSI escape code. * @return the ANSI escape code */ @Override diff --git a/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java b/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java index c0d9f272f0b..330e3c26b4d 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/ansi/AnsiOutput.java @@ -65,7 +65,7 @@ public abstract class AnsiOutput { } /** - * Returns if ANSI output is enabled + * Returns if ANSI output is enabled. * @return if ANSI enabled, disabled or detected */ public static Enabled getEnabled() { diff --git a/core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java b/core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java index a9f74cdc47d..94c1b03ff51 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java @@ -52,7 +52,7 @@ class ConfigDataProperties { * @param imports the imports requested * @param activate the activate properties */ - ConfigDataProperties(@Nullable @Name("import") List imports, @Nullable Activate activate) { + ConfigDataProperties(@Name("import") @Nullable List imports, @Nullable Activate activate) { this.imports = (imports != null) ? imports.stream().filter(ConfigDataLocation::isNotEmpty).toList() : Collections.emptyList(); this.activate = activate; diff --git a/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java b/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java index ba2bc58b35b..a39244be1f6 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/logging/log4j2/ColorConverter.java @@ -125,7 +125,7 @@ public final class ColorConverter extends LogEventPatternConverter { toAppendTo.append(AnsiOutput.toString(element, in)); } - protected void appendAnsiString(StringBuilder toAppendTo, String in, AnsiElement... elements) { + void appendAnsiString(StringBuilder toAppendTo, String in, AnsiElement... elements) { Object[] ansiParams = new Object[elements.length + 1]; System.arraycopy(elements, 0, ansiParams, 0, elements.length); ansiParams[elements.length] = in; diff --git a/core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java b/core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java index 0f1055a14f4..4146a2abf23 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/support/ReflectionEnvironmentPostProcessorsFactory.java @@ -43,7 +43,7 @@ class ReflectionEnvironmentPostProcessorsFactory implements EnvironmentPostProce private @Nullable ClassLoader classLoader; - private @Nullable final List classNames; + private final @Nullable List classNames; ReflectionEnvironmentPostProcessorsFactory(Class... classes) { this.classes = new ArrayList<>(Arrays.asList(classes)); diff --git a/core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java b/core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java index 2a2fb7b3354..90bbb55da10 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/support/SystemEnvironmentPropertySourceEnvironmentPostProcessor.java @@ -88,7 +88,6 @@ public class SystemEnvironmentPropertySourceEnvironmentPostProcessor implements * settings from a parent {@link ConfigurableEnvironment}. * @param environment the environment to post-process * @param parentEnvironment the parent environment - * @since 3.4.12 */ public static void postProcessEnvironment(ConfigurableEnvironment environment, ConfigurableEnvironment parentEnvironment) { diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java index eece843ebd7..fe298c08b4a 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/JavaBeanBinderTests.java @@ -42,6 +42,7 @@ import org.springframework.boot.convert.Delimiter; import org.springframework.core.ResolvableType; import org.springframework.core.convert.ConversionService; import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.format.annotation.DateTimeFormat.ISO; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; @@ -1062,7 +1063,7 @@ class JavaBeanBinderTests { static class ConverterAnnotatedExampleBean { - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + @DateTimeFormat(iso = ISO.DATE) private @Nullable LocalDate date; @Nullable LocalDate getDate() { diff --git a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java index dc0a21acb60..5295b778571 100644 --- a/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java +++ b/core/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/ValueObjectBinderTests.java @@ -38,6 +38,7 @@ import org.springframework.core.DefaultParameterNameDiscoverer; import org.springframework.core.ResolvableType; import org.springframework.core.convert.ConversionService; import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.format.annotation.DateTimeFormat.ISO; import org.springframework.util.Assert; import static org.assertj.core.api.Assertions.assertThat; @@ -697,8 +698,8 @@ class ValueObjectBinderTests { private final String bar; - ConverterAnnotatedExampleBean( - @DefaultValue("2019-05-10") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, String bar) { + ConverterAnnotatedExampleBean(@DefaultValue("2019-05-10") @DateTimeFormat(iso = ISO.DATE) LocalDate date, + String bar) { this.date = date; this.bar = bar; } diff --git a/gradle.properties b/gradle.properties index 80ae2cc3cba..f8fca625151 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,9 +13,15 @@ graalVersion=25 hamcrestVersion=3.0 jackson2Version=2.21.5 jacksonVersion=3.1.5 +<<<<<<< HEAD javaFormatVersion=0.0.47 junitJupiterVersion=6.1.3 kotlinVersion=2.4.10 +======= +javaFormatVersion=0.0.48 +junitJupiterVersion=6.0.3 +kotlinVersion=2.3.21 +>>>>>>> 4.1.x mavenVersion=3.9.13 mockitoVersion=5.23.0 nativeBuildToolsVersion=1.1.8 diff --git a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java index 4c61cfcc088..2d7eeb297fb 100644 --- a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java +++ b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java @@ -39,7 +39,7 @@ import org.springframework.util.Assert; @Endpoint(id = "shutdown", defaultAccess = Access.NONE) public class ShutdownEndpoint implements ApplicationContextAware { - @Nullable private ConfigurableApplicationContext context; + private @Nullable ConfigurableApplicationContext context; @WriteOperation public ShutdownDescriptor shutdown() { diff --git a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java index 807ceb0761b..c4a0fdcc535 100644 --- a/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java +++ b/module/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/env/EnvironmentEndpoint.java @@ -27,6 +27,7 @@ import java.util.regex.PatternSyntaxException; import java.util.stream.Stream; import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonInclude.Include; import org.jspecify.annotations.Nullable; import org.springframework.boot.actuate.endpoint.InvalidEndpointRequestException; @@ -252,7 +253,7 @@ public class EnvironmentEndpoint { /** * Description of an entry of the {@link Environment}. */ - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(Include.NON_NULL) public static final class EnvironmentEntryDescriptor { private final @Nullable PropertySummaryDescriptor property; @@ -292,7 +293,7 @@ public class EnvironmentEndpoint { /** * Description of a particular entry of the {@link Environment}. */ - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(Include.NON_NULL) public static final class PropertySummaryDescriptor { private final String source; @@ -341,7 +342,7 @@ public class EnvironmentEndpoint { /** * Description of a particular entry of {@link PropertySource}. */ - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(Include.NON_NULL) public static final class PropertySourceEntryDescriptor { private final String name; @@ -366,7 +367,7 @@ public class EnvironmentEndpoint { /** * Description of a property's value, including its origin if available. */ - @JsonInclude(JsonInclude.Include.NON_NULL) + @JsonInclude(Include.NON_NULL) public static final class PropertyValueDescriptor { private final @Nullable Object value; diff --git a/module/spring-boot-amqp-rabbitmq/src/main/java/org/springframework/boot/amqp/rabbitmq/autoconfigure/RabbitAmqpListenerContainerFactoryConfigurer.java b/module/spring-boot-amqp-rabbitmq/src/main/java/org/springframework/boot/amqp/rabbitmq/autoconfigure/RabbitAmqpListenerContainerFactoryConfigurer.java index deae4330a18..a3c6bffad6a 100644 --- a/module/spring-boot-amqp-rabbitmq/src/main/java/org/springframework/boot/amqp/rabbitmq/autoconfigure/RabbitAmqpListenerContainerFactoryConfigurer.java +++ b/module/spring-boot-amqp-rabbitmq/src/main/java/org/springframework/boot/amqp/rabbitmq/autoconfigure/RabbitAmqpListenerContainerFactoryConfigurer.java @@ -60,7 +60,7 @@ public final class RabbitAmqpListenerContainerFactoryConfigurer { * converter should be used. * @param messageConverter the {@link MessageConverter} */ - protected void setMessageConverter(@Nullable MessageConverter messageConverter) { + void setMessageConverter(@Nullable MessageConverter messageConverter) { this.messageConverter = messageConverter; } @@ -68,7 +68,7 @@ public final class RabbitAmqpListenerContainerFactoryConfigurer { * Set the {@link TaskScheduler} to use or {@code null} if the default should be used. * @param taskScheduler the {@link TaskScheduler} */ - protected void setTaskScheduler(@Nullable TaskScheduler taskScheduler) { + void setTaskScheduler(@Nullable TaskScheduler taskScheduler) { this.taskScheduler = taskScheduler; } diff --git a/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java b/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java index 0a3f8607d18..d564a4816ab 100644 --- a/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java +++ b/module/spring-boot-devtools/src/intTest/java/org/springframework/boot/devtools/tests/AbstractDevToolsIntegrationTests.java @@ -101,12 +101,12 @@ abstract class AbstractDevToolsIntegrationTests { this.classesDirectory = classesDirectory; } - protected ControllerBuilder withRequestMapping(String mapping) { + ControllerBuilder withRequestMapping(String mapping) { this.mappings.add(mapping); return this; } - protected void build() throws Exception { + void build() throws Exception { DynamicType.Builder builder = new ByteBuddy().subclass(Object.class) .name(this.name) .annotateType(AnnotationDescription.Builder.ofType(RestController.class).build()); diff --git a/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/ServletGrpcServerConfiguration.java b/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/ServletGrpcServerConfiguration.java index 5ac366e658a..a8c3f676ccd 100644 --- a/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/ServletGrpcServerConfiguration.java +++ b/module/spring-boot-grpc-server/src/main/java/org/springframework/boot/grpc/server/autoconfigure/ServletGrpcServerConfiguration.java @@ -21,6 +21,7 @@ import io.grpc.servlet.jakarta.GrpcServlet; import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; +import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type; import org.springframework.boot.diagnostics.FailureAnalyzedException; import org.springframework.boot.grpc.server.GrpcServletRegistration; import org.springframework.context.annotation.Bean; @@ -38,7 +39,7 @@ import org.springframework.grpc.server.service.GrpcServiceDiscoverer; * @author Phillip Webb */ @Configuration(proxyBeanMethods = false) -@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET) +@ConditionalOnWebApplication(type = Type.SERVLET) @ConditionalOnClass(GrpcServlet.class) @ConditionalOnMissingNetworkGrpcServer @ConditionalOnBooleanProperty(name = "spring.grpc.server.servlet.enabled", matchIfMissing = true) diff --git a/module/spring-boot-health/src/main/java/org/springframework/boot/health/autoconfigure/application/package-info.java b/module/spring-boot-health/src/main/java/org/springframework/boot/health/autoconfigure/application/package-info.java index 7b96c89b61e..17fa2b635b7 100644 --- a/module/spring-boot-health/src/main/java/org/springframework/boot/health/autoconfigure/application/package-info.java +++ b/module/spring-boot-health/src/main/java/org/springframework/boot/health/autoconfigure/application/package-info.java @@ -14,6 +14,9 @@ * limitations under the License. */ +/** + * Auto-configuration for application health indicators. + */ @NullMarked package org.springframework.boot.health.autoconfigure.application; diff --git a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/JacksonComponentModuleTests.java b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/JacksonComponentModuleTests.java index 06be782b0f8..bb7694d3e5c 100644 --- a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/JacksonComponentModuleTests.java +++ b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/JacksonComponentModuleTests.java @@ -34,6 +34,7 @@ import org.springframework.aot.test.generate.TestGenerationContext; import org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution; import org.springframework.beans.factory.aot.BeanFactoryInitializationCode; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.boot.jackson.JacksonComponent.Scope; import org.springframework.boot.jackson.JacksonComponentModule.JacksonComponentBeanFactoryInitializationAotProcessor; import org.springframework.boot.jackson.JacksonComponentModuleTests.ComponentWithInnerAbstractClass.AbstractSerializer; import org.springframework.boot.jackson.JacksonComponentModuleTests.ComponentWithInnerAbstractClass.ConcreteSerializer; @@ -236,12 +237,12 @@ class JacksonComponentModuleTests { } - @JacksonComponent(scope = JacksonComponent.Scope.KEYS) + @JacksonComponent(scope = Scope.KEYS) static class OnlyKeySerializer extends NameAndAgeJacksonKeyComponent.Serializer { } - @JacksonComponent(scope = JacksonComponent.Scope.KEYS, type = NameAndAge.class) + @JacksonComponent(scope = Scope.KEYS, type = NameAndAge.class) static class OnlyKeyDeserializer extends NameAndAgeJacksonKeyComponent.Deserializer { } diff --git a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/NameAndAgeJacksonKeyComponent.java b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/NameAndAgeJacksonKeyComponent.java index c4b24a8ee0a..eac257adf64 100644 --- a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/NameAndAgeJacksonKeyComponent.java +++ b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/NameAndAgeJacksonKeyComponent.java @@ -22,6 +22,7 @@ import tools.jackson.databind.KeyDeserializer; import tools.jackson.databind.SerializationContext; import tools.jackson.databind.ValueSerializer; +import org.springframework.boot.jackson.JacksonComponent.Scope; import org.springframework.boot.jackson.types.NameAndAge; /** @@ -29,7 +30,7 @@ import org.springframework.boot.jackson.types.NameAndAge; * * @author Paul Aly */ -@JacksonComponent(type = NameAndAge.class, scope = JacksonComponent.Scope.KEYS) +@JacksonComponent(type = NameAndAge.class, scope = Scope.KEYS) public class NameAndAgeJacksonKeyComponent { static class Serializer extends ValueSerializer { diff --git a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/SpringBeanHandlerInstantiatorTests.java b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/SpringBeanHandlerInstantiatorTests.java index 131a1b49a15..6f9c8ea065e 100644 --- a/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/SpringBeanHandlerInstantiatorTests.java +++ b/module/spring-boot-jackson/src/test/java/org/springframework/boot/jackson/autoconfigure/SpringBeanHandlerInstantiatorTests.java @@ -23,6 +23,7 @@ import java.util.Map; import java.util.function.Consumer; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; import org.jspecify.annotations.Nullable; import org.junit.jupiter.api.Test; import tools.jackson.core.JsonGenerator; @@ -251,7 +252,7 @@ class SpringBeanHandlerInstantiatorTests { } - @JsonTypeInfo(use = JsonTypeInfo.Id.CUSTOM, property = "type") + @JsonTypeInfo(use = Id.CUSTOM, property = "type") @JsonTypeResolver(CustomTypeResolverBuilder.class) @JsonTypeIdResolver(CustomTypeIdResolver.class) public static class Group { diff --git a/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/JsonComponentModuleTests.java b/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/JsonComponentModuleTests.java index ac22fd37a03..4ad2b4b2fc7 100644 --- a/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/JsonComponentModuleTests.java +++ b/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/JsonComponentModuleTests.java @@ -58,6 +58,7 @@ class JsonComponentModuleTests { private @Nullable AnnotationConfigApplicationContext context; + @Deprecated(since = "4.0.0", forRemoval = true) @AfterEach void closeContext() { if (this.context != null) { @@ -65,6 +66,7 @@ class JsonComponentModuleTests { } } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterSerializers() throws Exception { load(OnlySerializer.class); @@ -72,6 +74,7 @@ class JsonComponentModuleTests { assertSerialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterDeserializers() throws Exception { load(OnlyDeserializer.class); @@ -79,6 +82,7 @@ class JsonComponentModuleTests { assertDeserialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterInnerClasses() throws Exception { load(NameAndAgeJsonComponent.class); @@ -87,6 +91,7 @@ class JsonComponentModuleTests { assertDeserialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldAllowInnerAbstractClasses() throws Exception { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(JsonComponentModule.class, @@ -96,6 +101,7 @@ class JsonComponentModuleTests { context.close(); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterKeySerializers() throws Exception { load(OnlyKeySerializer.class); @@ -103,6 +109,7 @@ class JsonComponentModuleTests { assertKeySerialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterKeyDeserializers() throws Exception { load(OnlyKeyDeserializer.class); @@ -110,6 +117,7 @@ class JsonComponentModuleTests { assertKeyDeserialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterInnerClassesForKeyHandlers() throws Exception { load(NameAndAgeJsonKeyComponent.class); @@ -118,6 +126,7 @@ class JsonComponentModuleTests { assertKeyDeserialize(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void moduleShouldRegisterOnlyForSpecifiedClasses() throws Exception { load(NameAndCareerJsonComponent.class); @@ -127,6 +136,7 @@ class JsonComponentModuleTests { assertDeserializeForSpecifiedClasses(module); } + @Deprecated(since = "4.0.0", forRemoval = true) @Test void aotContributionRegistersReflectionHintsForSuitableInnerClasses() { load(ComponentWithInnerAbstractClass.class); @@ -214,39 +224,47 @@ class JsonComponentModuleTests { return context; } + @Deprecated(since = "4.0.0", forRemoval = true) @JsonComponent static class OnlySerializer extends NameAndAgeJsonComponent.Serializer { } + @Deprecated(since = "4.0.0", forRemoval = true) @JsonComponent static class OnlyDeserializer extends NameAndAgeJsonComponent.Deserializer { } + @Deprecated(since = "4.0.0", forRemoval = true) @JsonComponent static class ComponentWithInnerAbstractClass { + @Deprecated(since = "4.0.0", forRemoval = true) abstract static class AbstractSerializer extends NameAndAgeJsonComponent.Serializer { } + @Deprecated(since = "4.0.0", forRemoval = true) static class ConcreteSerializer extends AbstractSerializer { } + @Deprecated(since = "4.0.0", forRemoval = true) static class NotSuitable { } } - @JsonComponent(scope = JsonComponent.Scope.KEYS) + @Deprecated(since = "4.0.0", forRemoval = true) + @JsonComponent(scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS) static class OnlyKeySerializer extends NameAndAgeJsonKeyComponent.Serializer { } - @JsonComponent(scope = JsonComponent.Scope.KEYS, type = NameAndAge.class) + @Deprecated(since = "4.0.0", forRemoval = true) + @JsonComponent(scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS, type = NameAndAge.class) static class OnlyKeyDeserializer extends NameAndAgeJsonKeyComponent.Deserializer { } diff --git a/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/NameAndAgeJsonKeyComponent.java b/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/NameAndAgeJsonKeyComponent.java index c34f4b084fe..ae23b10310e 100644 --- a/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/NameAndAgeJsonKeyComponent.java +++ b/module/spring-boot-jackson2/src/test/java/org/springframework/boot/jackson2/NameAndAgeJsonKeyComponent.java @@ -34,11 +34,13 @@ import org.springframework.boot.jackson2.types.NameAndAge; */ @Deprecated(since = "4.0.0", forRemoval = true) @SuppressWarnings("removal") -@JsonComponent(type = NameAndAge.class, scope = JsonComponent.Scope.KEYS) +@JsonComponent(type = NameAndAge.class, scope = org.springframework.boot.jackson2.JsonComponent.Scope.KEYS) public class NameAndAgeJsonKeyComponent { + @Deprecated(since = "4.0.0", forRemoval = true) static class Serializer extends JsonSerializer { + @Deprecated(since = "4.0.0", forRemoval = true) @Override public void serialize(NameAndAge value, JsonGenerator jgen, SerializerProvider serializers) throws IOException { jgen.writeFieldName(value.asKey()); @@ -46,8 +48,10 @@ public class NameAndAgeJsonKeyComponent { } + @Deprecated(since = "4.0.0", forRemoval = true) static class Deserializer extends KeyDeserializer { + @Deprecated(since = "4.0.0", forRemoval = true) @Override public NameAndAge deserializeKey(String key, DeserializationContext ctxt) throws IOException { String[] keys = key.split("is"); diff --git a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java index b81c75adea5..082cd47e85c 100644 --- a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java +++ b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests.java @@ -23,6 +23,7 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace; import org.springframework.context.annotation.Configuration; import static org.assertj.core.api.Assertions.assertThat; @@ -34,8 +35,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Stephane Nicoll */ @JdbcTest -@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED, - connection = EmbeddedDatabaseConnection.HSQLDB) +@AutoConfigureTestDatabase(replace = Replace.AUTO_CONFIGURED, connection = EmbeddedDatabaseConnection.HSQLDB) class JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredIntegrationTests { @Autowired diff --git a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests.java b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests.java index c11ccf4f16f..285ac015ce9 100644 --- a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests.java +++ b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests.java @@ -21,6 +21,7 @@ import javax.sql.DataSource; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace; import static org.assertj.core.api.Assertions.assertThat; @@ -31,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Stephane Nicoll */ @JdbcTest -@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.AUTO_CONFIGURED) +@AutoConfigureTestDatabase(replace = Replace.AUTO_CONFIGURED) class JdbcTestWithAutoConfigureTestDatabaseReplaceAutoConfiguredWithoutOverrideIntegrationTests { @Autowired diff --git a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests.java b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests.java index 8c02c4d16e6..d6f9d83afcb 100644 --- a/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests.java +++ b/module/spring-boot-jdbc-test/src/test/java/org/springframework/boot/jdbc/test/autoconfigure/JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests.java @@ -21,6 +21,7 @@ import javax.sql.DataSource; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.jdbc.test.autoconfigure.AutoConfigureTestDatabase.Replace; import static org.assertj.core.api.Assertions.assertThat; @@ -31,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author Stephane Nicoll */ @JdbcTest -@AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) +@AutoConfigureTestDatabase(replace = Replace.NONE) class JdbcTestWithAutoConfigureTestDatabaseReplaceNoneIntegrationTests { @Autowired diff --git a/module/spring-boot-liquibase/src/main/java/org/springframework/boot/liquibase/autoconfigure/LiquibaseConnectionDetails.java b/module/spring-boot-liquibase/src/main/java/org/springframework/boot/liquibase/autoconfigure/LiquibaseConnectionDetails.java index 5be84609699..aaf2ddaa182 100644 --- a/module/spring-boot-liquibase/src/main/java/org/springframework/boot/liquibase/autoconfigure/LiquibaseConnectionDetails.java +++ b/module/spring-boot-liquibase/src/main/java/org/springframework/boot/liquibase/autoconfigure/LiquibaseConnectionDetails.java @@ -58,7 +58,7 @@ public interface LiquibaseConnectionDetails extends ConnectionDetails { * @see DatabaseDriver#fromJdbcUrl(String) * @see DatabaseDriver#getDriverClassName() */ - @Nullable default String getDriverClassName() { + default @Nullable String getDriverClassName() { String jdbcUrl = getJdbcUrl(); return (jdbcUrl != null) ? DatabaseDriver.fromJdbcUrl(jdbcUrl).getDriverClassName() : null; } diff --git a/module/spring-boot-rabbitmq/src/main/java/org/springframework/boot/rabbitmq/autoconfigure/AbstractRabbitListenerContainerFactoryConfigurer.java b/module/spring-boot-rabbitmq/src/main/java/org/springframework/boot/rabbitmq/autoconfigure/AbstractRabbitListenerContainerFactoryConfigurer.java index 16d9d1800ca..fdea2dbdbc9 100644 --- a/module/spring-boot-rabbitmq/src/main/java/org/springframework/boot/rabbitmq/autoconfigure/AbstractRabbitListenerContainerFactoryConfigurer.java +++ b/module/spring-boot-rabbitmq/src/main/java/org/springframework/boot/rabbitmq/autoconfigure/AbstractRabbitListenerContainerFactoryConfigurer.java @@ -102,7 +102,6 @@ public abstract class AbstractRabbitListenerContainerFactoryConfigurer