diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java index 0c1d64a42689..eea391d8a4f5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java @@ -149,12 +149,13 @@ public static class ClientRequest { */ private String metricName = "http.client.requests"; - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @DeprecatedConfigurationProperty(replacement = "management.observations.http.client.requests.name") public String getMetricName() { return this.metricName; } + @Deprecated(since = "3.0.0", forRemoval = true) public void setMetricName(String metricName) { this.metricName = metricName; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java index 18e5664ece35..91c710100843 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceProperties.java @@ -20,7 +20,6 @@ import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties; import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; /** * {@link ConfigurationProperties @ConfigurationProperties} for configuring Dynatrace @@ -56,28 +55,6 @@ public void setApiToken(String apiToken) { this.apiToken = apiToken; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.device-id") - public String getDeviceId() { - return this.v1.getDeviceId(); - } - - @Deprecated - public void setDeviceId(String deviceId) { - this.v1.setDeviceId(deviceId); - } - - @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.technology-type") - public String getTechnologyType() { - return this.v1.getTechnologyType(); - } - - @Deprecated - public void setTechnologyType(String technologyType) { - this.v1.setTechnologyType(technologyType); - } - public String getUri() { return this.uri; } @@ -86,17 +63,6 @@ public void setUri(String uri) { this.uri = uri; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "management.dynatrace.metrics.export.v1.group") - public String getGroup() { - return this.v1.getGroup(); - } - - @Deprecated - public void setGroup(String group) { - this.v1.setGroup(group); - } - public V1 getV1() { return this.v1; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java index 49aca96b8a42..9b12576ced6c 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfiguration.java @@ -30,8 +30,6 @@ import io.prometheus.client.exemplars.tracer.common.SpanContextSupplier; import io.prometheus.client.exporter.BasicAuthHttpConnectionFactory; import io.prometheus.client.exporter.PushGateway; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint; @@ -52,7 +50,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.env.Environment; -import org.springframework.core.log.LogMessage; import org.springframework.util.StringUtils; /** @@ -120,8 +117,6 @@ public PrometheusScrapeEndpoint prometheusEndpoint(CollectorRegistry collectorRe @ConditionalOnProperty(prefix = "management.prometheus.metrics.export.pushgateway", name = "enabled") public static class PrometheusPushGatewayConfiguration { - private static final Log logger = LogFactory.getLog(PrometheusPushGatewayConfiguration.class); - /** * The fallback job name. We use 'spring' since there's a history of Prometheus * spring integration defaulting to that name from when Prometheus integration @@ -132,7 +127,7 @@ public static class PrometheusPushGatewayConfiguration { @Bean @ConditionalOnMissingBean public PrometheusPushGatewayManager prometheusPushGatewayManager(CollectorRegistry collectorRegistry, - PrometheusProperties prometheusProperties, Environment environment) { + PrometheusProperties prometheusProperties, Environment environment) throws MalformedURLException { PrometheusProperties.Pushgateway properties = prometheusProperties.getPushgateway(); Duration pushRate = properties.getPushRate(); String job = getJob(properties, environment); @@ -147,15 +142,8 @@ public PrometheusPushGatewayManager prometheusPushGatewayManager(CollectorRegist shutdownOperation); } - private PushGateway initializePushGateway(String url) { - try { - return new PushGateway(new URL(url)); - } - catch (MalformedURLException ex) { - logger.warn(LogMessage - .format("Invalid PushGateway base url '%s': update your configuration to a valid URL", url)); - return new PushGateway(url); - } + private PushGateway initializePushGateway(String url) throws MalformedURLException { + return new PushGateway(new URL(url)); } private String getJob(PrometheusProperties.Pushgateway properties, Environment environment) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapter.java index d0ca3bf170b9..197ec6bc21e5 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapter.java @@ -30,7 +30,7 @@ * * @author Brian Clozel */ -@SuppressWarnings("deprecation") +@SuppressWarnings({ "removal" }) class ClientHttpObservationConventionAdapter implements ClientHttpObservationConvention { private final String metricName; @@ -48,6 +48,7 @@ public boolean supportsContext(Observation.Context context) { } @Override + @SuppressWarnings("deprecation") public KeyValues getLowCardinalityKeyValues(ClientHttpObservationContext context) { KeyValues keyValues = KeyValues.empty(); Iterable tags = this.tagsProvider.getTags(context.getUriTemplate(), context.getCarrier(), diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientObservationConventionAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientObservationConventionAdapter.java index 16b076bb0a9f..0653a39a4bc6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientObservationConventionAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientObservationConventionAdapter.java @@ -32,7 +32,7 @@ * * @author Brian Clozel */ -@SuppressWarnings("deprecation") +@SuppressWarnings({ "deprecation", "removal" }) class ClientObservationConventionAdapter implements ClientObservationConvention { private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate"; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/HttpClientObservationsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/HttpClientObservationsAutoConfiguration.java index 57dd668dd8bb..ad4117eeb8d9 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/HttpClientObservationsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/HttpClientObservationsAutoConfiguration.java @@ -62,7 +62,7 @@ class MeterFilterConfiguration { @Bean @Order(0) - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") MeterFilter metricsHttpClientUriTagFilter(ObservationProperties observationProperties, MetricsProperties metricsProperties) { String metricName = metricsProperties.getWeb().getClient().getRequest().getMetricName(); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfiguration.java index d23e53a30cbb..5ab46d18644e 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfiguration.java @@ -40,7 +40,7 @@ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(RestTemplate.class) @ConditionalOnBean(RestTemplateBuilder.class) -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") class RestTemplateObservationConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/WebClientObservationConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/WebClientObservationConfiguration.java index a09ff5253083..16e0b7829cad 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/WebClientObservationConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/WebClientObservationConfiguration.java @@ -37,7 +37,7 @@ */ @Configuration(proxyBeanMethods = false) @ConditionalOnClass(WebClient.class) -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") class WebClientObservationConfiguration { @Bean diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java index ab3fc810b5d0..0ea1923820ff 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerAdapter.java @@ -61,7 +61,7 @@ public ModelAndView handle(HttpServletRequest request, HttpServletResponse respo } @Override - @Deprecated + @Deprecated(since = "2.4.9", forRemoval = false) @SuppressWarnings("deprecation") public long getLastModified(HttpServletRequest request, Object handler) { Optional adapter = getAdapter(handler); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java index 9a532eb18c50..47028a921ceb 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatraceMetricsExportAutoConfigurationTests.java @@ -50,7 +50,7 @@ void backsOffWithoutAClock() { @Test void failsWithADeviceIdWithoutAUri() { this.contextRunner.withUserConfiguration(BaseConfiguration.class) - .withPropertyValues("management.dynatrace.metrics.export.device-id:dev-1") + .withPropertyValues("management.dynatrace.metrics.export.v1.device-id:dev-1") .run((context) -> assertThat(context).hasFailed()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapterTests.java index 97117ce9adb5..86143ac76f5f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesConfigAdapterTests.java @@ -45,14 +45,6 @@ void whenPropertiesApiTokenIsSetAdapterApiTokenReturnsIt() { assertThat(new DynatracePropertiesConfigAdapter(properties).apiToken()).isEqualTo("123ABC"); } - @Test - @Deprecated - void whenPropertiesDeviceIdIsSetAdapterDeviceIdReturnsIt() { - DynatraceProperties properties = new DynatraceProperties(); - properties.setDeviceId("dev-1"); - assertThat(new DynatracePropertiesConfigAdapter(properties).deviceId()).isEqualTo("dev-1"); - } - @Test void whenPropertiesV1DeviceIdIsSetAdapterDeviceIdReturnsIt() { DynatraceProperties properties = new DynatraceProperties(); @@ -60,14 +52,6 @@ void whenPropertiesV1DeviceIdIsSetAdapterDeviceIdReturnsIt() { assertThat(new DynatracePropertiesConfigAdapter(properties).deviceId()).isEqualTo("dev-1"); } - @Test - @Deprecated - void whenPropertiesTechnologyTypeIsSetAdapterTechnologyTypeReturnsIt() { - DynatraceProperties properties = new DynatraceProperties(); - properties.setTechnologyType("tech-1"); - assertThat(new DynatracePropertiesConfigAdapter(properties).technologyType()).isEqualTo("tech-1"); - } - @Test void whenPropertiesV1TechnologyTypeIsSetAdapterTechnologyTypeReturnsIt() { DynatraceProperties properties = new DynatraceProperties(); @@ -75,14 +59,6 @@ void whenPropertiesV1TechnologyTypeIsSetAdapterTechnologyTypeReturnsIt() { assertThat(new DynatracePropertiesConfigAdapter(properties).technologyType()).isEqualTo("tech-1"); } - @Test - @Deprecated - void whenPropertiesGroupIsSetAdapterGroupReturnsIt() { - DynatraceProperties properties = new DynatraceProperties(); - properties.setGroup("group-1"); - assertThat(new DynatracePropertiesConfigAdapter(properties).group()).isEqualTo("group-1"); - } - @Test void whenPropertiesV1GroupIsSetAdapterGroupReturnsIt() { DynatraceProperties properties = new DynatraceProperties(); @@ -90,14 +66,6 @@ void whenPropertiesV1GroupIsSetAdapterGroupReturnsIt() { assertThat(new DynatracePropertiesConfigAdapter(properties).group()).isEqualTo("group-1"); } - @Test - @SuppressWarnings("deprecation") - void whenDeviceIdIsSetThenAdapterApiVersionIsV1() { - DynatraceProperties properties = new DynatraceProperties(); - properties.setDeviceId("dev-1"); - assertThat(new DynatracePropertiesConfigAdapter(properties).apiVersion()).isSameAs(DynatraceApiVersion.V1); - } - @Test void whenV1DeviceIdIsSetThenAdapterApiVersionIsV1() { DynatraceProperties properties = new DynatraceProperties(); @@ -144,7 +112,6 @@ void whenPropertiesDefaultDimensionsIsSetAdapterDefaultDimensionsReturnsIt() { } @Test - @SuppressWarnings("deprecation") void defaultValues() { DynatraceProperties properties = new DynatraceProperties(); assertThat(properties.getApiToken()).isNull(); @@ -156,9 +123,6 @@ void defaultValues() { assertThat(properties.getV2().isEnrichWithDynatraceMetadata()).isTrue(); assertThat(properties.getV2().getDefaultDimensions()).isNull(); assertThat(properties.getV2().isUseDynatraceSummaryInstruments()).isTrue(); - assertThat(properties.getDeviceId()).isNull(); - assertThat(properties.getTechnologyType()).isEqualTo("java"); - assertThat(properties.getGroup()).isNull(); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesTests.java index 4a73aff6e69c..619fc423255f 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/dynatrace/DynatracePropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -30,13 +30,11 @@ */ class DynatracePropertiesTests extends StepRegistryPropertiesTests { - @SuppressWarnings("deprecation") @Test void defaultValuesAreConsistent() { DynatraceProperties properties = new DynatraceProperties(); DynatraceConfig config = (key) -> null; assertStepRegistryDefaultValues(properties, config); - assertThat(properties.getTechnologyType()).isEqualTo(config.technologyType()); assertThat(properties.getV1().getTechnologyType()).isEqualTo(config.technologyType()); } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java index bac0a47fa848..bde2db3c5ee1 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/prometheus/PrometheusMetricsExportAutoConfigurationTests.java @@ -181,18 +181,6 @@ void withPushGatewayNoBasicAuth() { .isInstanceOf(DefaultHttpConnectionFactory.class))); } - @Test - @Deprecated - void withCustomLegacyPushGatewayURL(CapturedOutput output) { - this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) - .withPropertyValues("management.prometheus.metrics.export.pushgateway.enabled=true", - "management.prometheus.metrics.export.pushgateway.base-url=localhost:9090") - .withUserConfiguration(BaseConfiguration.class).run((context) -> { - assertThat(output).contains("Invalid PushGateway base url").contains("localhost:9090"); - hasGatewayURL(context, "http://localhost:9090/metrics/"); - }); - } - @Test void withCustomPushGatewayURL() { this.contextRunner.withConfiguration(AutoConfigurations.of(ManagementContextAutoConfiguration.class)) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jdbc/DataSourcePoolMetricsAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jdbc/DataSourcePoolMetricsAutoConfigurationTests.java index 69ac60e281ec..12e21aecf5a6 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jdbc/DataSourcePoolMetricsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/jdbc/DataSourcePoolMetricsAutoConfigurationTests.java @@ -114,17 +114,6 @@ void autoConfiguredHikariDataSourceIsInstrumented() { }); } - @Test - @Deprecated - void autoConfiguredHikariDataSourceIsInstrumentedWhenUsingDeprecatedDataSourceInitialization() { - this.contextRunner.withPropertyValues("spring.datasource.schema:db/create-custom-schema.sql") - .withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)).run((context) -> { - context.getBean(DataSource.class).getConnection(); - MeterRegistry registry = context.getBean(MeterRegistry.class); - registry.get("hikaricp.connections").meter(); - }); - } - @Test void autoConfiguredHikariDataSourceIsInstrumentedWhenUsingDataSourceInitialization() { this.contextRunner.withPropertyValues("spring.sql.init.schema:db/create-custom-schema.sql").withConfiguration( diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapterTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapterTests.java index 66ff823bdd69..9ee0437adfa8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapterTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/ClientHttpObservationConventionAdapterTests.java @@ -39,7 +39,7 @@ * * @author Brian Clozel */ -@SuppressWarnings("deprecation") +@SuppressWarnings({ "deprecation", "removal" }) class ClientHttpObservationConventionAdapterTests { private static final String TEST_METRIC_NAME = "test.metric.name"; diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfigurationTests.java index dbb9e079eac3..2af29ca18ae3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateObservationConfigurationTests.java @@ -54,7 +54,7 @@ * @author Brian Clozel */ @ExtendWith(OutputCaptureExtension.class) -@SuppressWarnings("deprecation") +@SuppressWarnings({ "deprecation", "removal" }) class RestTemplateObservationConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner().with(MetricsRun.simple()) @@ -161,6 +161,7 @@ CustomTagsProvider customTagsProvider() { } + @Deprecated(since = "3.0.0", forRemoval = true) static class CustomTagsProvider implements RestTemplateExchangeTagsProvider { @Override diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java index 5a2aee920ce3..20f17a3baa3c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/HealthEndpoint.java @@ -48,18 +48,6 @@ public class HealthEndpoint extends HealthEndpointSupport transactionProvider, - ObjectProvider recordMapperProvider, - ObjectProvider recordUnmapperProvider, ObjectProvider settings, - ObjectProvider recordListenerProviders, - ObjectProvider visitListenerProviders, - ObjectProvider transactionListenerProviders, - ObjectProvider executorProvider) { - return new OrderedDefaultConfigurationCustomizer((configuration) -> { - transactionProvider.ifAvailable(configuration::set); - recordMapperProvider.ifAvailable(configuration::set); - recordUnmapperProvider.ifAvailable(configuration::set); - settings.ifAvailable(configuration::set); - executorProvider.ifAvailable(configuration::set); - configuration.set(recordListenerProviders.orderedStream().toArray(RecordListenerProvider[]::new)); - configuration.set(visitListenerProviders.orderedStream().toArray(VisitListenerProvider[]::new)); - configuration.setTransactionListenerProvider( - transactionListenerProviders.orderedStream().toArray(TransactionListenerProvider[]::new)); - }); - } - - } - - private static class OrderedDefaultConfigurationCustomizer implements DefaultConfigurationCustomizer, Ordered { - - private final DefaultConfigurationCustomizer delegate; - - OrderedDefaultConfigurationCustomizer(DefaultConfigurationCustomizer delegate) { - this.delegate = delegate; - } - - @Override - public void customize(DefaultConfiguration configuration) { - this.delegate.customize(configuration); - - } - - @Override - public int getOrder() { - return 0; - } - } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java index 1207db386048..478897d053d9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 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. @@ -257,13 +257,13 @@ public void setLabelFilter(String labelFilter) { this.labelFilter = labelFilter; } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @DeprecatedConfigurationProperty(replacement = "spring.liquibase.label-filter") public String getLabels() { return getLabelFilter(); } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) public void setLabels(String labels) { setLabelFilter(labels); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfiguration.java index 39c52b4d3061..bfc06a8bbb0a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfiguration.java @@ -22,7 +22,6 @@ import java.util.List; import java.util.Locale; import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; import java.util.stream.Collectors; import org.neo4j.driver.AuthToken; @@ -72,17 +71,13 @@ public Driver neo4jDriver(Neo4jProperties properties, Environment environment, } URI determineServerUri(Neo4jProperties properties, Environment environment) { - return getOrFallback(properties.getUri(), () -> { - URI deprecatedProperty = environment.getProperty("spring.data.neo4j.uri", URI.class); - return (deprecatedProperty != null) ? deprecatedProperty : DEFAULT_SERVER_URI; - }); + URI uri = properties.getUri(); + return (uri != null) ? uri : DEFAULT_SERVER_URI; } AuthToken mapAuthToken(Neo4jProperties.Authentication authentication, Environment environment) { - String username = getOrFallback(authentication.getUsername(), - () -> environment.getProperty("spring.data.neo4j.username", String.class)); - String password = getOrFallback(authentication.getPassword(), - () -> environment.getProperty("spring.data.neo4j.password", String.class)); + String username = authentication.getUsername(); + String password = authentication.getPassword(); String kerberosTicket = authentication.getKerberosTicket(); String realm = authentication.getRealm(); @@ -103,13 +98,6 @@ AuthToken mapAuthToken(Neo4jProperties.Authentication authentication, Environmen return AuthTokens.none(); } - private T getOrFallback(T value, Supplier fallback) { - if (value != null) { - return value; - } - return fallback.get(); - } - Config mapDriverConfig(Neo4jProperties properties, List customizers) { Config.ConfigBuilder builder = Config.builder(); configurePoolSettings(builder, properties.getPool()); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 128d751a6b49..ca119825effd 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -1400,13 +1400,13 @@ public void setInitialBufferSize(DataSize initialBufferSize) { this.initialBufferSize = initialBufferSize; } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @DeprecatedConfigurationProperty(reason = "Deprecated for removal in Reactor Netty") public DataSize getMaxChunkSize() { return this.maxChunkSize; } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) public void setMaxChunkSize(DataSize maxChunkSize) { this.maxChunkSize = maxChunkSize; } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java index 382ef4bf2bf2..c943eb28110c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizer.java @@ -102,7 +102,7 @@ private void customizeRequestDecoder(NettyReactiveWebServerFactory factory, Prop })); } - @SuppressWarnings("deprecation") + @SuppressWarnings({ "deprecation", "removal" }) private void maxChunkSize(PropertyMapper propertyMapper, HttpRequestDecoderSpec httpRequestDecoderSpec, ServerProperties.Netty nettyProperties) { propertyMapper.from(nettyProperties.getMaxChunkSize()).whenNonNull() diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java index fd2d801cc8b2..93b2b3d5a453 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java @@ -175,7 +175,6 @@ public OrderedFormContentFilter formContentFilter() { // Defined as a nested config to ensure WebMvcConfigurer is not read when not // on the classpath - @SuppressWarnings("deprecation") @Configuration(proxyBeanMethods = false) @Import(EnableWebMvcConfiguration.class) @EnableConfigurationProperties({ WebMvcProperties.class, WebProperties.class }) @@ -212,7 +211,6 @@ public WebMvcAutoConfigurationAdapter(WebProperties webProperties, WebMvcPropert this.resourceHandlerRegistrationCustomizer = resourceHandlerRegistrationCustomizerProvider.getIfAvailable(); this.dispatcherServletPath = dispatcherServletPath; this.servletRegistrations = servletRegistrations; - this.mvcProperties.checkConfiguration(); } @Override @@ -246,9 +244,6 @@ public void configurePathMatch(PathMatchConfigurer configurer) { if (this.mvcProperties.getPathmatch() .getMatchingStrategy() == WebMvcProperties.MatchingStrategy.ANT_PATH_MATCHER) { configurer.setPathMatcher(new AntPathMatcher()); - configurer.setUseSuffixPatternMatch(this.mvcProperties.getPathmatch().isUseSuffixPattern()); - configurer.setUseRegisteredSuffixPatternMatch( - this.mvcProperties.getPathmatch().isUseRegisteredSuffixPattern()); this.dispatcherServletPath.ifAvailable((dispatcherPath) -> { String servletUrlMapping = dispatcherPath.getServletUrlMapping(); if (servletUrlMapping.equals("/") && singleDispatcherServlet()) { @@ -268,7 +263,6 @@ private boolean singleDispatcherServlet() { @Override public void configureContentNegotiation(ContentNegotiationConfigurer configurer) { WebMvcProperties.Contentnegotiation contentnegotiation = this.mvcProperties.getContentnegotiation(); - configurer.favorPathExtension(contentnegotiation.isFavorPathExtension()); configurer.favorParameter(contentnegotiation.isFavorParameter()); if (contentnegotiation.getParameterName() != null) { configurer.parameterName(contentnegotiation.getParameterName()); @@ -417,7 +411,7 @@ public RequestMappingHandlerAdapter requestMappingHandlerAdapter( return adapter; } - @SuppressWarnings("deprecation") + @SuppressWarnings({ "deprecation", "removal" }) private void setIgnoreDefaultModelOnRedirect(RequestMappingHandlerAdapter adapter) { adapter.setIgnoreDefaultModelOnRedirect( this.mvcProperties == null || this.mvcProperties.isIgnoreDefaultModelOnRedirect()); @@ -460,7 +454,7 @@ public LocaleResolver localeResolver() { @Override @Bean @ConditionalOnMissingBean(name = DispatcherServlet.THEME_RESOLVER_BEAN_NAME) - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = false) @SuppressWarnings("deprecation") public org.springframework.web.servlet.ThemeResolver themeResolver() { return super.themeResolver(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java index 1a16006bbccd..b779bf5299f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcProperties.java @@ -22,7 +22,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; -import org.springframework.boot.context.properties.IncompatibleConfigurationException; import org.springframework.http.MediaType; import org.springframework.util.Assert; import org.springframework.validation.DefaultMessageCodesResolver; @@ -115,28 +114,17 @@ public void setMessageCodesResolverFormat(DefaultMessageCodesResolver.Format mes this.messageCodesResolverFormat = messageCodesResolverFormat; } - @Deprecated - @DeprecatedConfigurationProperty(replacement = "spring.mvc.format.date") - public String getDateFormat() { - return this.format.getDate(); - } - - @Deprecated - public void setDateFormat(String dateFormat) { - this.format.setDate(dateFormat); - } - public Format getFormat() { return this.format; } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @DeprecatedConfigurationProperty(reason = "Deprecated for removal in Spring MVC") public boolean isIgnoreDefaultModelOnRedirect() { return this.ignoreDefaultModelOnRedirect; } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) public void setIgnoreDefaultModelOnRedirect(boolean ignoreDefaultModelOnRedirect) { this.ignoreDefaultModelOnRedirect = ignoreDefaultModelOnRedirect; } @@ -225,19 +213,6 @@ public Pathmatch getPathmatch() { return this.pathmatch; } - public void checkConfiguration() { - if (this.getPathmatch().getMatchingStrategy() == MatchingStrategy.PATH_PATTERN_PARSER) { - if (this.getPathmatch().isUseSuffixPattern()) { - throw new IncompatibleConfigurationException("spring.mvc.pathmatch.matching-strategy", - "spring.mvc.pathmatch.use-suffix-pattern"); - } - if (this.getPathmatch().isUseRegisteredSuffixPattern()) { - throw new IncompatibleConfigurationException("spring.mvc.pathmatch.matching-strategy", - "spring.mvc.pathmatch.use-registered-suffix-pattern"); - } - } - } - public static class Async { /** @@ -351,13 +326,6 @@ public void setSuffix(String suffix) { public static class Contentnegotiation { - /** - * Whether the path extension in the URL path should be used to determine the - * requested media type. If enabled a request "/users.pdf" will be interpreted as - * a request for "application/pdf" regardless of the 'Accept' header. - */ - private boolean favorPathExtension = false; - /** * Whether a request parameter ("format" by default) should be used to determine * the requested media type. @@ -375,18 +343,6 @@ public static class Contentnegotiation { */ private String parameterName; - @DeprecatedConfigurationProperty( - reason = "Use of path extensions for request mapping and for content negotiation is discouraged.") - @Deprecated - public boolean isFavorPathExtension() { - return this.favorPathExtension; - } - - @Deprecated - public void setFavorPathExtension(boolean favorPathExtension) { - this.favorPathExtension = favorPathExtension; - } - public boolean isFavorParameter() { return this.favorParameter; } @@ -420,22 +376,6 @@ public static class Pathmatch { */ private MatchingStrategy matchingStrategy = MatchingStrategy.PATH_PATTERN_PARSER; - /** - * Whether to use suffix pattern match (".*") when matching patterns to requests. - * If enabled a method mapped to "/users" also matches to "/users.*". Enabling - * this option is not compatible with the PathPatternParser matching strategy. - */ - private boolean useSuffixPattern = false; - - /** - * Whether suffix pattern matching should work only against extensions registered - * with "spring.mvc.contentnegotiation.media-types.*". This is generally - * recommended to reduce ambiguity and to avoid issues such as when a "." appears - * in the path for other reasons. Enabling this option is not compatible with the - * PathPatternParser matching strategy. - */ - private boolean useRegisteredSuffixPattern = false; - public MatchingStrategy getMatchingStrategy() { return this.matchingStrategy; } @@ -444,30 +384,6 @@ public void setMatchingStrategy(MatchingStrategy matchingStrategy) { this.matchingStrategy = matchingStrategy; } - @DeprecatedConfigurationProperty( - reason = "Use of path extensions for request mapping and for content negotiation is discouraged.") - @Deprecated - public boolean isUseSuffixPattern() { - return this.useSuffixPattern; - } - - @Deprecated - public void setUseSuffixPattern(boolean useSuffixPattern) { - this.useSuffixPattern = useSuffixPattern; - } - - @DeprecatedConfigurationProperty( - reason = "Use of path extensions for request mapping and for content negotiation is discouraged.") - @Deprecated - public boolean isUseRegisteredSuffixPattern() { - return this.useRegisteredSuffixPattern; - } - - @Deprecated - public void setUseRegisteredSuffixPattern(boolean useRegisteredSuffixPattern) { - this.useRegisteredSuffixPattern = useRegisteredSuffixPattern; - } - } public static class Format { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 2debd65b4871..37e215c30bda 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -1034,7 +1034,7 @@ "description": "Login password of the server.", "deprecation": { "replacement": "spring.neo4j.authentication.password", - "level": "warning" + "level": "error" } }, { @@ -1059,7 +1059,7 @@ "description": "URI used by the driver. Auto-detected by default.", "deprecation": { "replacement": "spring.neo4j.uri", - "level": "warning" + "level": "error" } }, { @@ -1077,7 +1077,7 @@ "description": "Login user of the server.", "deprecation": { "replacement": "spring.neo4j.authentication.username", - "level": "warning" + "level": "error" } }, { @@ -2047,6 +2047,14 @@ "type": "java.lang.String", "description": "Preferred JSON mapper to use for HTTP message conversion. By default, auto-detected according to the environment." }, + { + "name": "spring.mvc.date-format", + "type": "java.lang.String", + "description": "Date format to use, for example 'dd/MM/yyyy'.", + "deprecation": { + "level": "error" + } + }, { "name": "spring.mvc.favicon.enabled", "type": "java.lang.Boolean", diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java index bef9932c253e..ce1d6f7fb675 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfigurationTests.java @@ -24,14 +24,8 @@ import org.jooq.DSLContext; import org.jooq.ExecuteListener; import org.jooq.ExecuteListenerProvider; -import org.jooq.ExecutorProvider; -import org.jooq.RecordListenerProvider; -import org.jooq.RecordMapperProvider; -import org.jooq.RecordUnmapperProvider; import org.jooq.SQLDialect; -import org.jooq.TransactionListenerProvider; import org.jooq.TransactionalRunnable; -import org.jooq.VisitListenerProvider; import org.jooq.impl.DataSourceConnectionProvider; import org.jooq.impl.DefaultExecuteListenerProvider; import org.junit.jupiter.api.Test; @@ -153,33 +147,6 @@ void dslContextWithConfigurationCustomizersAreApplied() { }); } - @Test - @Deprecated - void customProvidersArePickedUp() { - RecordMapperProvider recordMapperProvider = mock(RecordMapperProvider.class); - RecordUnmapperProvider recordUnmapperProvider = mock(RecordUnmapperProvider.class); - RecordListenerProvider recordListenerProvider = mock(RecordListenerProvider.class); - VisitListenerProvider visitListenerProvider = mock(VisitListenerProvider.class); - TransactionListenerProvider transactionListenerProvider = mock(TransactionListenerProvider.class); - ExecutorProvider executorProvider = mock(ExecutorProvider.class); - this.contextRunner.withUserConfiguration(JooqDataSourceConfiguration.class, TxManagerConfiguration.class) - .withBean(RecordMapperProvider.class, () -> recordMapperProvider) - .withBean(RecordUnmapperProvider.class, () -> recordUnmapperProvider) - .withBean(RecordListenerProvider.class, () -> recordListenerProvider) - .withBean(VisitListenerProvider.class, () -> visitListenerProvider) - .withBean(TransactionListenerProvider.class, () -> transactionListenerProvider) - .withBean(ExecutorProvider.class, () -> executorProvider).run((context) -> { - DSLContext dsl = context.getBean(DSLContext.class); - assertThat(dsl.configuration().recordMapperProvider()).isSameAs(recordMapperProvider); - assertThat(dsl.configuration().recordUnmapperProvider()).isSameAs(recordUnmapperProvider); - assertThat(dsl.configuration().executorProvider()).isSameAs(executorProvider); - assertThat(dsl.configuration().recordListenerProviders()).containsExactly(recordListenerProvider); - assertThat(dsl.configuration().visitListenerProviders()).containsExactly(visitListenerProvider); - assertThat(dsl.configuration().transactionListenerProviders()) - .containsExactly(transactionListenerProvider); - }); - } - @Test void relaxedBindingOfSqlDialect() { this.contextRunner.withUserConfiguration(JooqDataSourceConfiguration.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java index 272f4f203215..59430e2df6b9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java @@ -303,7 +303,7 @@ void overrideLabelFilter() { } @Test - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) void overrideLabelFilterWithDeprecatedLabelsProperty() { this.contextRunner.withUserConfiguration(EmbeddedDataSourceConfiguration.class) .withPropertyValues("spring.liquibase.labels:test, production").run(assertLiquibase( diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfigurationTests.java index 53da5280903e..91f2e69757c8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/neo4j/Neo4jAutoConfigurationTests.java @@ -131,26 +131,6 @@ void determineServerUriWithCustomUriShouldOverrideDefault() { assertThat(determineServerUri(properties, new MockEnvironment())).isEqualTo(customUri); } - @Test - @Deprecated - void determineServerUriWithDeprecatedPropertyShouldOverrideDefault() { - URI customUri = URI.create("bolt://localhost:4242"); - MockEnvironment environment = new MockEnvironment().withProperty("spring.data.neo4j.uri", customUri.toString()); - assertThat(determineServerUri(new Neo4jProperties(), environment)).isEqualTo(customUri); - } - - @Test - @Deprecated - void determineServerUriWithCustomUriShouldTakePrecedenceOverDeprecatedProperty() { - URI customUri = URI.create("bolt://localhost:4242"); - URI anotherCustomURI = URI.create("bolt://localhost:2424"); - Neo4jProperties properties = new Neo4jProperties(); - properties.setUri(customUri); - MockEnvironment environment = new MockEnvironment().withProperty("spring.data.neo4j.uri", - anotherCustomURI.toString()); - assertThat(determineServerUri(properties, environment)).isEqualTo(customUri); - } - @Test void authenticationShouldDefaultToNone() { assertThat(mapAuthToken(new Authentication())).isEqualTo(AuthTokens.none()); @@ -173,25 +153,6 @@ void authenticationWithUsernameAndRealmShouldEnableBasicAuth() { assertThat(mapAuthToken(authentication)).isEqualTo(AuthTokens.basic("Farin", "Urlaub", "Test Realm")); } - @Test - @Deprecated - void authenticationWithUsernameUsingDeprecatedPropertiesShouldEnableBasicAuth() { - MockEnvironment environment = new MockEnvironment().withProperty("spring.data.neo4j.username", "user") - .withProperty("spring.data.neo4j.password", "secret"); - assertThat(mapAuthToken(new Authentication(), environment)).isEqualTo(AuthTokens.basic("user", "secret")); - } - - @Test - @Deprecated - void authenticationWithUsernameShouldTakePrecedenceOverDeprecatedPropertiesAndEnableBasicAuth() { - MockEnvironment environment = new MockEnvironment().withProperty("spring.data.neo4j.username", "user") - .withProperty("spring.data.neo4j.password", "secret"); - Authentication authentication = new Authentication(); - authentication.setUsername("Farin"); - authentication.setPassword("Urlaub"); - assertThat(mapAuthToken(authentication, environment)).isEqualTo(AuthTokens.basic("Farin", "Urlaub")); - } - @Test void authenticationWithKerberosTicketShouldEnableKerberos() { Authentication authentication = new Authentication(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java index 4b2dfc185f3a..92c998acc234 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/ServerPropertiesTests.java @@ -516,7 +516,8 @@ void undertowMaxHttpPostSizeMatchesDefault() { } @Test - @SuppressWarnings("deprecation") + @Deprecated(since = "3.0.0", forRemoval = true) + @SuppressWarnings("removal") void nettyMaxChunkSizeMatchesHttpDecoderSpecDefault() { assertThat(this.properties.getNetty().getMaxChunkSize().toBytes()) .isEqualTo(HttpDecoderSpec.DEFAULT_MAX_CHUNK_SIZE); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizerTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizerTests.java index 696dc5bf10bb..e2267a005a74 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizerTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/embedded/NettyWebServerFactoryCustomizerTests.java @@ -147,12 +147,12 @@ void configureHttpRequestDecoder() { assertThat(decoder.maxInitialLineLength()).isEqualTo(nettyProperties.getMaxInitialLineLength().toBytes()); } - @SuppressWarnings("deprecation") + @SuppressWarnings("removal") private void setMaxChunkSize(ServerProperties.Netty nettyProperties) { nettyProperties.setMaxChunkSize(DataSize.ofKilobytes(16)); } - @SuppressWarnings("deprecation") + @SuppressWarnings({ "deprecation", "removal" }) private void assertMaxChunkSize(ServerProperties.Netty nettyProperties, HttpRequestDecoderSpec decoder) { assertThat(decoder.maxChunkSize()).isEqualTo(nettyProperties.getMaxChunkSize().toBytes()); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java index e1098b7f9cc2..9421e84a5a45 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java @@ -46,7 +46,6 @@ import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration; import org.springframework.boot.autoconfigure.validation.ValidatorAdapter; import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter; -import org.springframework.boot.context.properties.IncompatibleConfigurationException; import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext; import org.springframework.boot.test.context.runner.ContextConsumer; import org.springframework.boot.test.context.runner.WebApplicationContextRunner; @@ -70,7 +69,6 @@ import org.springframework.format.support.FormattingConversionService; import org.springframework.http.CacheControl; import org.springframework.http.HttpHeaders; -import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.util.ReflectionTestUtils; @@ -78,10 +76,8 @@ import org.springframework.validation.Validator; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; import org.springframework.web.accept.ContentNegotiationManager; -import org.springframework.web.accept.ContentNegotiationStrategy; import org.springframework.web.accept.ParameterContentNegotiationStrategy; import org.springframework.web.bind.support.ConfigurableWebBindingInitializer; -import org.springframework.web.context.request.ServletWebRequest; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.FormContentFilter; @@ -371,7 +367,7 @@ void customLocaleResolverWithDifferentNameDoesNotReplaceAutoConfiguredLocaleReso } @Test - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @SuppressWarnings("deprecation") void customThemeResolverWithMatchingNameReplacesDefaultThemeResolver() { this.contextRunner.withBean("themeResolver", CustomThemeResolver.class, CustomThemeResolver::new) @@ -382,7 +378,7 @@ void customThemeResolverWithMatchingNameReplacesDefaultThemeResolver() { } @Test - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) @SuppressWarnings("deprecation") void customThemeResolverWithDifferentNameDoesNotReplaceDefaultThemeResolver() { this.contextRunner.withBean("customThemeResolver", CustomThemeResolver.class, CustomThemeResolver::new) @@ -430,15 +426,6 @@ void customDateFormat() { }); } - @Test - void customDateFormatWithDeprecatedProperty() { - this.contextRunner.withPropertyValues("spring.mvc.date-format:dd*MM*yyyy").run((context) -> { - FormattingConversionService conversionService = context.getBean(FormattingConversionService.class); - Date date = Date.from(ZonedDateTime.of(1988, 6, 25, 20, 30, 0, 0, ZoneId.systemDefault()).toInstant()); - assertThat(conversionService.convert(date, String.class)).isEqualTo("25*06*1988"); - }); - } - @Test void defaultTimeFormat() { this.contextRunner.run((context) -> { @@ -570,10 +557,9 @@ void asyncTaskExecutorWithCustomNonApplicationTaskExecutor() { } @Test - @Deprecated void customMediaTypes() { - this.contextRunner.withPropertyValues("spring.mvc.contentnegotiation.media-types.yaml:text/yaml", - "spring.mvc.contentnegotiation.favor-path-extension:true").run((context) -> { + this.contextRunner.withPropertyValues("spring.mvc.contentnegotiation.media-types.yaml:text/yaml") + .run((context) -> { RequestMappingHandlerAdapter adapter = context.getBean(RequestMappingHandlerAdapter.class); ContentNegotiationManager contentNegotiationManager = (ContentNegotiationManager) ReflectionTestUtils .getField(adapter, "contentNegotiationManager"); @@ -841,29 +827,6 @@ void cacheControl() { })); } - @Test - @SuppressWarnings("deprecation") - void defaultPathMatching() { - this.contextRunner.run((context) -> { - RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class); - assertThat(handlerMapping.useSuffixPatternMatch()).isFalse(); - assertThat(handlerMapping.useRegisteredSuffixPatternMatch()).isFalse(); - }); - } - - @Test - @Deprecated - @SuppressWarnings("deprecation") - void useSuffixPatternMatch() { - this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy=ant-path-matcher", - "spring.mvc.pathmatch.use-suffix-pattern:true", - "spring.mvc.pathmatch.use-registered-suffix-pattern:true").run((context) -> { - RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class); - assertThat(handlerMapping.useSuffixPatternMatch()).isTrue(); - assertThat(handlerMapping.useRegisteredSuffixPatternMatch()).isTrue(); - }); - } - @Test void usePathPatternParser() { this.contextRunner.withPropertyValues("spring.mvc.pathmatch.matching-strategy:path_pattern_parser") @@ -873,15 +836,6 @@ void usePathPatternParser() { }); } - @Test - void incompatiblePathMatchingConfiguration() { - this.contextRunner - .withPropertyValues("spring.mvc.pathmatch.matching-strategy:path_pattern_parser", - "spring.mvc.pathmatch.use-suffix-pattern:true") - .run((context) -> assertThat(context.getStartupFailure()).rootCause() - .isInstanceOf(IncompatibleConfigurationException.class)); - } - @Test void defaultContentNegotiation() { this.contextRunner.run((context) -> { @@ -893,19 +847,6 @@ void defaultContentNegotiation() { } @Test - @Deprecated - void pathExtensionContentNegotiation() { - this.contextRunner.withPropertyValues("spring.mvc.contentnegotiation.favor-path-extension:true") - .run((context) -> { - RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class); - ContentNegotiationManager contentNegotiationManager = handlerMapping.getContentNegotiationManager(); - assertThat(contentNegotiationManager.getStrategies()).hasAtLeastOneElementOfType( - WebMvcAutoConfiguration.OptionalPathExtensionContentNegotiationStrategy.class); - }); - } - - @Test - @Deprecated void queryParameterContentNegotiation() { this.contextRunner.withPropertyValues("spring.mvc.contentnegotiation.favor-parameter:true").run((context) -> { RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class); @@ -925,21 +866,6 @@ void customConfigurerAppliedAfterAutoConfig() { }); } - @Test - @SuppressWarnings("deprecation") - void contentNegotiationStrategySkipsPathExtension() throws Exception { - ContentNegotiationStrategy delegate = mock(ContentNegotiationStrategy.class); - ContentNegotiationStrategy strategy = new WebMvcAutoConfiguration.OptionalPathExtensionContentNegotiationStrategy( - delegate); - MockHttpServletRequest request = new MockHttpServletRequest(); - request.setAttribute( - org.springframework.web.accept.PathExtensionContentNegotiationStrategy.class.getName() + ".SKIP", - Boolean.TRUE); - ServletWebRequest webRequest = new ServletWebRequest(request); - List mediaTypes = strategy.resolveMediaTypes(webRequest); - assertThat(mediaTypes).containsOnly(MediaType.ALL); - } - @Test void requestContextFilterIsAutoConfigured() { this.contextRunner.run((context) -> assertThat(context).hasSingleBean(RequestContextFilter.class)); @@ -1485,7 +1411,7 @@ public void setLocale(HttpServletRequest request, HttpServletResponse response, } - @Deprecated + @Deprecated(since = "3.0.0", forRemoval = true) static class CustomThemeResolver implements org.springframework.web.servlet.ThemeResolver { @Override diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java index 9370cdb5778e..6103ade4cb74 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcPropertiesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -22,7 +22,6 @@ import org.assertj.core.util.Throwables; import org.junit.jupiter.api.Test; -import org.springframework.boot.context.properties.IncompatibleConfigurationException; import org.springframework.boot.context.properties.bind.BindException; import org.springframework.boot.context.properties.bind.Bindable; import org.springframework.boot.context.properties.bind.Binder; @@ -62,24 +61,6 @@ void servletPathWhenHasWildcardThrowsException() { (ex) -> assertThat(Throwables.getRootCause(ex)).hasMessage("Path must not contain wildcards")); } - @Test - @SuppressWarnings("deprecation") - void incompatiblePathMatchSuffixConfig() { - this.properties.getPathmatch().setMatchingStrategy(WebMvcProperties.MatchingStrategy.PATH_PATTERN_PARSER); - this.properties.getPathmatch().setUseSuffixPattern(true); - assertThatExceptionOfType(IncompatibleConfigurationException.class) - .isThrownBy(this.properties::checkConfiguration); - } - - @Test - @SuppressWarnings("deprecation") - void incompatiblePathMatchRegisteredSuffixConfig() { - this.properties.getPathmatch().setMatchingStrategy(WebMvcProperties.MatchingStrategy.PATH_PATTERN_PARSER); - this.properties.getPathmatch().setUseRegisteredSuffixPattern(true); - assertThatExceptionOfType(IncompatibleConfigurationException.class) - .isThrownBy(this.properties::checkConfiguration); - } - private void bind(String name, String value) { bind(Collections.singletonMap(name, value)); } diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc index 56f0e866fdaa..a125fc511093 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc @@ -231,31 +231,6 @@ Most standard media types are supported out-of-the-box, but you can also define -Suffix pattern matching is deprecated and will be removed in a future release. -If you understand the caveats and would still like your application to use suffix pattern matching, the following configuration is required: - -[source,yaml,indent=0,subs="verbatim",configblocks] ----- - spring: - mvc: - contentnegotiation: - favor-path-extension: true - pathmatch: - use-suffix-pattern: true ----- - -Alternatively, rather than open all suffix patterns, it is more secure to only support registered suffix patterns: - -[source,yaml,indent=0,subs="verbatim",configblocks] ----- - spring: - mvc: - contentnegotiation: - favor-path-extension: true - pathmatch: - use-registered-suffix-pattern: true ----- - As of Spring Framework 5.3, Spring MVC supports several implementation strategies for matching request paths to Controller handlers. It was previously only supporting the `AntPathMatcher` strategy, but it now also offers `PathPatternParser`. Spring Boot now provides a configuration property to choose and opt in the new strategy: @@ -271,11 +246,8 @@ Spring Boot now provides a configuration property to choose and opt in the new s For more details on why you should consider this new implementation, see the https://spring.io/blog/2020/06/30/url-matching-with-pathpattern-in-spring-mvc[dedicated blog post]. -NOTE: `PathPatternParser` is an optimized implementation but restricts usage of -{spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path patterns variants] -and is incompatible with suffix pattern matching (configprop:spring.mvc.pathmatch.use-suffix-pattern[deprecated], -configprop:spring.mvc.pathmatch.use-registered-suffix-pattern[deprecated]) or mapping the `DispatcherServlet` -with a servlet prefix (configprop:spring.mvc.servlet.path[]). +NOTE: `PathPatternParser` is an optimized implementation but restricts usage of {spring-framework-docs}/web.html#mvc-ann-requestmapping-uri-templates[some path patterns variants]. +It is incompatible with suffix pattern matching or mapping the `DispatcherServlet` with a servlet prefix (configprop:spring.mvc.servlet.path[]). diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetrics.java b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetrics.java index f6ae74dd978c..44ec896236d4 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetrics.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetrics.java @@ -38,7 +38,7 @@ @Retention(RetentionPolicy.RUNTIME) @Documented @Inherited -@Deprecated +@Deprecated(since = "3.0.0", forRemoval = true) @AutoConfigureObservability(tracing = false) public @interface AutoConfigureMetrics { diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java index 4a2780c95775..dfdef02bdb2c 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/actuate/metrics/AutoConfigureMetricsPresentIntegrationTests.java @@ -32,9 +32,10 @@ * * @author Chris Bono */ -@SuppressWarnings("deprecation") +@SuppressWarnings("removal") @SpringBootTest @AutoConfigureMetrics +@Deprecated(since = "3.0.0", forRemoval = true) class AutoConfigureMetricsPresentIntegrationTests { @Test diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java index 29d390efd564..f7fdf2122394 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2022 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. @@ -58,7 +58,7 @@ public interface ApplicationContextAssertProvider * @deprecated to prevent accidental use. Prefer standard AssertJ * {@code assertThat(context)...} calls instead. */ - @Deprecated + @Deprecated(since = "2.0.0", forRemoval = false) @Override ApplicationContextAssert assertThat(); diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java index cda1bd9d0415..94169a62e854 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/json/JsonContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -76,7 +76,7 @@ public JsonContent(Class resourceLoadClass, ResolvableType type, String json) * {@code assertThat(context)...} calls instead. */ @Override - @Deprecated + @Deprecated(since = "1.5.7", forRemoval = false) public JsonContentAssert assertThat() { return new JsonContentAssert(this.resourceLoadClass, null, this.json, this.configuration); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java index 0614e622a8e6..be9bc1b086f0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java @@ -103,7 +103,7 @@ public Iterator getNestedArchives(EntryFilter searchFilter, EntryFilter } @Override - @Deprecated + @Deprecated(since = "2.3.10", forRemoval = false) public Iterator iterator() { return new EntryIterator(this.root, this.recursive, null, null); } @@ -322,7 +322,7 @@ public Iterator getNestedArchives(EntryFilter searchFilter, EntryFilter } @Override - @Deprecated + @Deprecated(since = "2.3.10", forRemoval = false) public Iterator iterator() { return Collections.emptyIterator(); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java index bab4125f5c31..b30c8bb37a52 100755 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/JarFileArchive.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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 Iterator getNestedArchives(EntryFilter searchFilter, EntryFilter } @Override - @Deprecated + @Deprecated(since = "2.3.10", forRemoval = false) public Iterator iterator() { return new EntryIterator(this.jarFile.iterator(), null, null); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java index 44ed3dc42b36..427719ca22aa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/AbstractArchiveIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -59,10 +59,10 @@ protected String launchScript(File jar) { } protected AssertProvider jar(File file) { - return new AssertProvider() { + return new AssertProvider<>() { @Override - @Deprecated + @Deprecated(since = "2.3.0", forRemoval = false) public JarAssert assertThat() { return new JarAssert(file); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java index 3c648a0d98c3..aed0440a5d01 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/BuildInfoIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -114,10 +114,10 @@ private ProjectCallback buildInfo(String location, Consumer buildInfo(File project, String buildInfo) { - return new AssertProvider() { + return new AssertProvider<>() { @Override - @Deprecated + @Deprecated(since = "2.3.0", forRemoval = false) public BuildInfoAssert assertThat() { return new BuildInfoAssert(new File(project, buildInfo)); } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java index a553fc8298fb..03fa92bec5f2 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/PropertiesMergingResourceTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2022 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. @@ -58,7 +58,7 @@ public boolean canTransformResource(String resource) { } @Override - @Deprecated + @Deprecated(since = "2.4.0", forRemoval = false) public void processResource(String resource, InputStream inputStream, List relocators) throws IOException { processResource(resource, inputStream, relocators, 0); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/SslServerCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/SslServerCustomizer.java index 821bd9577fb1..7b0189179aef 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/SslServerCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/SslServerCustomizer.java @@ -60,7 +60,7 @@ * @since 2.0.0 * @deprecated this class is meant for Spring Boot internal use only. */ -@Deprecated +@Deprecated(since = "2.0.0", forRemoval = false) public class SslServerCustomizer implements NettyServerCustomizer { private final Ssl ssl;