mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Add since version to deprecated config properties
See gh-36482
This commit is contained in:
parent
2e50d11d86
commit
f2ad08c292
@ -79,7 +79,8 @@ public class MetricsProperties {
|
||||
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() {
|
||||
return this.tags;
|
||||
}
|
||||
|
@ -50,6 +50,7 @@ public class PropertiesMeterFilter implements MeterFilter {
|
||||
|
||||
private final MeterFilter mapFilter;
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
public PropertiesMeterFilter(MetricsProperties properties) {
|
||||
Assert.notNull(properties, "Properties must not be null");
|
||||
this.properties = properties;
|
||||
|
@ -78,11 +78,13 @@ public class OtlpProperties extends StepRegistryProperties {
|
||||
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() {
|
||||
return this.resourceAttributes;
|
||||
}
|
||||
|
||||
@Deprecated(since = "3.2.0", forRemoval = true)
|
||||
public void setResourceAttributes(Map<String, String> resourceAttributes) {
|
||||
this.resourceAttributes = resourceAttributes;
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ class OtlpPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<Ot
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public Map<String, String> resourceAttributes() {
|
||||
if (!CollectionUtils.isEmpty(this.openTelemetryProperties.getResourceAttributes())) {
|
||||
return this.openTelemetryProperties.getResourceAttributes();
|
||||
|
@ -65,6 +65,7 @@ class OtlpPropertiesConfigAdapterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void whenPropertiesResourceAttributesIsSetAdapterResourceAttributesReturnsIt() {
|
||||
this.properties.setResourceAttributes(Map.of("service.name", "boot-service"));
|
||||
assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "boot-service");
|
||||
@ -88,6 +89,7 @@ class OtlpPropertiesConfigAdapterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void openTelemetryPropertiesShouldOverrideOtlpPropertiesIfNotEmpty() {
|
||||
this.properties.setResourceAttributes(Map.of("a", "alpha"));
|
||||
this.openTelemetryProperties.setResourceAttributes(Map.of("b", "beta"));
|
||||
@ -95,6 +97,7 @@ class OtlpPropertiesConfigAdapterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void openTelemetryPropertiesShouldNotOverrideOtlpPropertiesIfEmpty() {
|
||||
this.properties.setResourceAttributes(Map.of("a", "alpha"));
|
||||
this.openTelemetryProperties.setResourceAttributes(Collections.emptyMap());
|
||||
|
@ -180,7 +180,8 @@ public class CouchbaseProperties {
|
||||
|
||||
@Deprecated(since = "3.1.0", forRemoval = true)
|
||||
@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() {
|
||||
return this.keyStore;
|
||||
}
|
||||
@ -192,7 +193,8 @@ public class CouchbaseProperties {
|
||||
|
||||
@Deprecated(since = "3.1.0", forRemoval = true)
|
||||
@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() {
|
||||
return this.keyStorePassword;
|
||||
}
|
||||
|
@ -736,7 +736,7 @@ public class FlywayProperties {
|
||||
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)
|
||||
public Boolean getOracleSqlplus() {
|
||||
return getOracle().getSqlplus();
|
||||
@ -747,7 +747,7 @@ public class FlywayProperties {
|
||||
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)
|
||||
public Boolean getOracleSqlplusWarn() {
|
||||
return getOracle().getSqlplusWarn();
|
||||
@ -758,7 +758,7 @@ public class FlywayProperties {
|
||||
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)
|
||||
public String getOracleWalletLocation() {
|
||||
return getOracle().getWalletLocation();
|
||||
@ -809,7 +809,7 @@ public class FlywayProperties {
|
||||
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)
|
||||
public String getOracleKerberosCacheFile() {
|
||||
return getOracle().getKerberosCacheFile();
|
||||
|
@ -48,7 +48,8 @@ public class InfluxDbProperties {
|
||||
*/
|
||||
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() {
|
||||
return this.url;
|
||||
}
|
||||
@ -57,7 +58,8 @@ public class InfluxDbProperties {
|
||||
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() {
|
||||
return this.user;
|
||||
}
|
||||
@ -66,7 +68,8 @@ public class InfluxDbProperties {
|
||||
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() {
|
||||
return this.password;
|
||||
}
|
||||
|
@ -837,7 +837,8 @@ public class KafkaProperties {
|
||||
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)
|
||||
public DataSize getCacheMaxSizeBuffering() {
|
||||
return this.cacheMaxSizeBuffering;
|
||||
|
@ -623,11 +623,13 @@ public class ServerProperties {
|
||||
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() {
|
||||
return this.rejectIllegalHeader;
|
||||
}
|
||||
|
||||
@Deprecated(since = "3.2.0", forRemoval = true)
|
||||
public void setRejectIllegalHeader(boolean rejectIllegalHeader) {
|
||||
this.rejectIllegalHeader = rejectIllegalHeader;
|
||||
}
|
||||
@ -1634,7 +1636,7 @@ public class ServerProperties {
|
||||
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")
|
||||
public boolean isAllowEncodedSlash() {
|
||||
return this.allowEncodedSlash;
|
||||
|
@ -84,6 +84,7 @@ public class TomcatWebServerFactoryCustomizer
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
public void customize(ConfigurableTomcatWebServerFactory factory) {
|
||||
ServerProperties.Tomcat properties = this.serverProperties.getTomcat();
|
||||
PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
|
||||
|
@ -126,7 +126,8 @@ public class WebMvcProperties {
|
||||
|
||||
@Deprecated(since = "3.2.0", forRemoval = true)
|
||||
@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() {
|
||||
return this.throwExceptionIfNoHandlerFound;
|
||||
}
|
||||
|
@ -114,6 +114,7 @@ class ServerPropertiesTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void testTomcatBinding() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("server.tomcat.accesslog.conditionIf", "foo");
|
||||
@ -423,6 +424,7 @@ class ServerPropertiesTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("removal")
|
||||
void tomcatRejectIllegalHeaderMatchesProtocolDefault() throws Exception {
|
||||
assertThat(getDefaultProtocol()).hasFieldOrPropertyWithValue("rejectIllegalHeader",
|
||||
this.properties.getTomcat().isRejectIllegalHeader());
|
||||
|
Loading…
Reference in New Issue
Block a user