Add since version to deprecated config properties

See gh-36482
This commit is contained in:
Scott Frederick 2023-08-01 14:38:42 -05:00
parent 2e50d11d86
commit f2ad08c292
13 changed files with 35 additions and 15 deletions

View File

@ -79,7 +79,8 @@ public class MetricsProperties {
return this.enable; return this.enable;
} }
@DeprecatedConfigurationProperty(replacement = "management.observations.key-values") @Deprecated(since = "3.2.0", forRemoval = true)
@DeprecatedConfigurationProperty(replacement = "management.observations.key-values", since = "3.2.0")
public Map<String, String> getTags() { public Map<String, String> getTags() {
return this.tags; return this.tags;
} }

View File

@ -50,6 +50,7 @@ public class PropertiesMeterFilter implements MeterFilter {
private final MeterFilter mapFilter; private final MeterFilter mapFilter;
@SuppressWarnings("removal")
public PropertiesMeterFilter(MetricsProperties properties) { public PropertiesMeterFilter(MetricsProperties properties) {
Assert.notNull(properties, "Properties must not be null"); Assert.notNull(properties, "Properties must not be null");
this.properties = properties; this.properties = properties;

View File

@ -78,11 +78,13 @@ public class OtlpProperties extends StepRegistryProperties {
this.aggregationTemporality = aggregationTemporality; this.aggregationTemporality = aggregationTemporality;
} }
@DeprecatedConfigurationProperty(replacement = "management.opentelemetry.resource-attributes") @Deprecated(since = "3.2.0", forRemoval = true)
@DeprecatedConfigurationProperty(replacement = "management.opentelemetry.resource-attributes", since = "3.2.0")
public Map<String, String> getResourceAttributes() { public Map<String, String> getResourceAttributes() {
return this.resourceAttributes; return this.resourceAttributes;
} }
@Deprecated(since = "3.2.0", forRemoval = true)
public void setResourceAttributes(Map<String, String> resourceAttributes) { public void setResourceAttributes(Map<String, String> resourceAttributes) {
this.resourceAttributes = resourceAttributes; this.resourceAttributes = resourceAttributes;
} }

View File

@ -58,6 +58,7 @@ class OtlpPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<Ot
} }
@Override @Override
@SuppressWarnings("removal")
public Map<String, String> resourceAttributes() { public Map<String, String> resourceAttributes() {
if (!CollectionUtils.isEmpty(this.openTelemetryProperties.getResourceAttributes())) { if (!CollectionUtils.isEmpty(this.openTelemetryProperties.getResourceAttributes())) {
return this.openTelemetryProperties.getResourceAttributes(); return this.openTelemetryProperties.getResourceAttributes();

View File

@ -65,6 +65,7 @@ class OtlpPropertiesConfigAdapterTests {
} }
@Test @Test
@SuppressWarnings("removal")
void whenPropertiesResourceAttributesIsSetAdapterResourceAttributesReturnsIt() { void whenPropertiesResourceAttributesIsSetAdapterResourceAttributesReturnsIt() {
this.properties.setResourceAttributes(Map.of("service.name", "boot-service")); this.properties.setResourceAttributes(Map.of("service.name", "boot-service"));
assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "boot-service"); assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "boot-service");
@ -88,6 +89,7 @@ class OtlpPropertiesConfigAdapterTests {
} }
@Test @Test
@SuppressWarnings("removal")
void openTelemetryPropertiesShouldOverrideOtlpPropertiesIfNotEmpty() { void openTelemetryPropertiesShouldOverrideOtlpPropertiesIfNotEmpty() {
this.properties.setResourceAttributes(Map.of("a", "alpha")); this.properties.setResourceAttributes(Map.of("a", "alpha"));
this.openTelemetryProperties.setResourceAttributes(Map.of("b", "beta")); this.openTelemetryProperties.setResourceAttributes(Map.of("b", "beta"));
@ -95,6 +97,7 @@ class OtlpPropertiesConfigAdapterTests {
} }
@Test @Test
@SuppressWarnings("removal")
void openTelemetryPropertiesShouldNotOverrideOtlpPropertiesIfEmpty() { void openTelemetryPropertiesShouldNotOverrideOtlpPropertiesIfEmpty() {
this.properties.setResourceAttributes(Map.of("a", "alpha")); this.properties.setResourceAttributes(Map.of("a", "alpha"));
this.openTelemetryProperties.setResourceAttributes(Collections.emptyMap()); this.openTelemetryProperties.setResourceAttributes(Collections.emptyMap());

View File

@ -180,7 +180,8 @@ public class CouchbaseProperties {
@Deprecated(since = "3.1.0", forRemoval = true) @Deprecated(since = "3.1.0", forRemoval = true)
@DeprecatedConfigurationProperty( @DeprecatedConfigurationProperty(
reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead") reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead",
since = "3.1.0")
public String getKeyStore() { public String getKeyStore() {
return this.keyStore; return this.keyStore;
} }
@ -192,7 +193,8 @@ public class CouchbaseProperties {
@Deprecated(since = "3.1.0", forRemoval = true) @Deprecated(since = "3.1.0", forRemoval = true)
@DeprecatedConfigurationProperty( @DeprecatedConfigurationProperty(
reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead") reason = "SSL bundle support with spring.ssl.bundle and spring.couchbase.env.ssl.bundle should be used instead",
since = "3.1.0")
public String getKeyStorePassword() { public String getKeyStorePassword() {
return this.keyStorePassword; return this.keyStorePassword;
} }

View File

@ -736,7 +736,7 @@ public class FlywayProperties {
this.licenseKey = licenseKey; this.licenseKey = licenseKey;
} }
@DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus") @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus", since = "3.2.0")
@Deprecated(since = "3.2.0", forRemoval = true) @Deprecated(since = "3.2.0", forRemoval = true)
public Boolean getOracleSqlplus() { public Boolean getOracleSqlplus() {
return getOracle().getSqlplus(); return getOracle().getSqlplus();
@ -747,7 +747,7 @@ public class FlywayProperties {
getOracle().setSqlplus(oracleSqlplus); getOracle().setSqlplus(oracleSqlplus);
} }
@DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus-warn") @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.sqlplus-warn", since = "3.2.0")
@Deprecated(since = "3.2.0", forRemoval = true) @Deprecated(since = "3.2.0", forRemoval = true)
public Boolean getOracleSqlplusWarn() { public Boolean getOracleSqlplusWarn() {
return getOracle().getSqlplusWarn(); return getOracle().getSqlplusWarn();
@ -758,7 +758,7 @@ public class FlywayProperties {
getOracle().setSqlplusWarn(oracleSqlplusWarn); getOracle().setSqlplusWarn(oracleSqlplusWarn);
} }
@DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.wallet-location") @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.wallet-location", since = "3.2.0")
@Deprecated(since = "3.2.0", forRemoval = true) @Deprecated(since = "3.2.0", forRemoval = true)
public String getOracleWalletLocation() { public String getOracleWalletLocation() {
return getOracle().getWalletLocation(); return getOracle().getWalletLocation();
@ -809,7 +809,7 @@ public class FlywayProperties {
this.kerberosConfigFile = kerberosConfigFile; this.kerberosConfigFile = kerberosConfigFile;
} }
@DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.kerberos-cache-file") @DeprecatedConfigurationProperty(replacement = "spring.flyway.oracle.kerberos-cache-file", since = "3.2.0")
@Deprecated(since = "3.2.0", forRemoval = true) @Deprecated(since = "3.2.0", forRemoval = true)
public String getOracleKerberosCacheFile() { public String getOracleKerberosCacheFile() {
return getOracle().getKerberosCacheFile(); return getOracle().getKerberosCacheFile();

View File

@ -48,7 +48,8 @@ public class InfluxDbProperties {
*/ */
private String password; private String password;
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration",
since = "3.2.0")
public String getUrl() { public String getUrl() {
return this.url; return this.url;
} }
@ -57,7 +58,8 @@ public class InfluxDbProperties {
this.url = url; this.url = url;
} }
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration",
since = "3.2.0")
public String getUser() { public String getUser() {
return this.user; return this.user;
} }
@ -66,7 +68,8 @@ public class InfluxDbProperties {
this.user = user; this.user = user;
} }
@DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration") @DeprecatedConfigurationProperty(reason = "the new InfluxDb Java client provides Spring Boot integration",
since = "3.2.0")
public String getPassword() { public String getPassword() {
return this.password; return this.password;
} }

View File

@ -837,7 +837,8 @@ public class KafkaProperties {
this.bootstrapServers = bootstrapServers; this.bootstrapServers = bootstrapServers;
} }
@DeprecatedConfigurationProperty(replacement = "spring.kafka.streams.state-store-cache-max-size") @DeprecatedConfigurationProperty(replacement = "spring.kafka.streams.state-store-cache-max-size",
since = "3.1.0")
@Deprecated(since = "3.1.0", forRemoval = true) @Deprecated(since = "3.1.0", forRemoval = true)
public DataSize getCacheMaxSizeBuffering() { public DataSize getCacheMaxSizeBuffering() {
return this.cacheMaxSizeBuffering; return this.cacheMaxSizeBuffering;

View File

@ -623,11 +623,13 @@ public class ServerProperties {
this.connectionTimeout = connectionTimeout; this.connectionTimeout = connectionTimeout;
} }
@DeprecatedConfigurationProperty(reason = "The setting has been deprecated in Tomcat") @Deprecated(since = "3.2.0", forRemoval = true)
@DeprecatedConfigurationProperty(reason = "The setting has been deprecated in Tomcat", since = "3.2.0")
public boolean isRejectIllegalHeader() { public boolean isRejectIllegalHeader() {
return this.rejectIllegalHeader; return this.rejectIllegalHeader;
} }
@Deprecated(since = "3.2.0", forRemoval = true)
public void setRejectIllegalHeader(boolean rejectIllegalHeader) { public void setRejectIllegalHeader(boolean rejectIllegalHeader) {
this.rejectIllegalHeader = rejectIllegalHeader; this.rejectIllegalHeader = rejectIllegalHeader;
} }
@ -1634,7 +1636,7 @@ public class ServerProperties {
this.maxCookies = maxCookies; this.maxCookies = maxCookies;
} }
@DeprecatedConfigurationProperty(replacement = "server.undertow.decode-slash") @DeprecatedConfigurationProperty(replacement = "server.undertow.decode-slash", since = "3.0.3")
@Deprecated(forRemoval = true, since = "3.0.3") @Deprecated(forRemoval = true, since = "3.0.3")
public boolean isAllowEncodedSlash() { public boolean isAllowEncodedSlash() {
return this.allowEncodedSlash; return this.allowEncodedSlash;

View File

@ -84,6 +84,7 @@ public class TomcatWebServerFactoryCustomizer
} }
@Override @Override
@SuppressWarnings("removal")
public void customize(ConfigurableTomcatWebServerFactory factory) { public void customize(ConfigurableTomcatWebServerFactory factory) {
ServerProperties.Tomcat properties = this.serverProperties.getTomcat(); ServerProperties.Tomcat properties = this.serverProperties.getTomcat();
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull(); PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();

View File

@ -126,7 +126,8 @@ public class WebMvcProperties {
@Deprecated(since = "3.2.0", forRemoval = true) @Deprecated(since = "3.2.0", forRemoval = true)
@DeprecatedConfigurationProperty( @DeprecatedConfigurationProperty(
reason = "DispatcherServlet property is deprecated for removal and should no longer need to be configured") reason = "DispatcherServlet property is deprecated for removal and should no longer need to be configured",
since = "3.2.0")
public boolean isThrowExceptionIfNoHandlerFound() { public boolean isThrowExceptionIfNoHandlerFound() {
return this.throwExceptionIfNoHandlerFound; return this.throwExceptionIfNoHandlerFound;
} }

View File

@ -114,6 +114,7 @@ class ServerPropertiesTests {
} }
@Test @Test
@SuppressWarnings("removal")
void testTomcatBinding() { void testTomcatBinding() {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("server.tomcat.accesslog.conditionIf", "foo"); map.put("server.tomcat.accesslog.conditionIf", "foo");
@ -423,6 +424,7 @@ class ServerPropertiesTests {
} }
@Test @Test
@SuppressWarnings("removal")
void tomcatRejectIllegalHeaderMatchesProtocolDefault() throws Exception { void tomcatRejectIllegalHeaderMatchesProtocolDefault() throws Exception {
assertThat(getDefaultProtocol()).hasFieldOrPropertyWithValue("rejectIllegalHeader", assertThat(getDefaultProtocol()).hasFieldOrPropertyWithValue("rejectIllegalHeader",
this.properties.getTomcat().isRejectIllegalHeader()); this.properties.getTomcat().isRejectIllegalHeader());