Browse Source

Apply configuration properties deprecation consistently

This commit makes sure that both the getter and the setter of a
deprecated configuration properties is flagged with `@Deprecated`.

Closes gh-20812
pull/21037/head
Stephane Nicoll 6 years ago
parent
commit
90c0378a7d
  1. 10
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorProperties.java
  2. 5
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java
  3. 3
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java
  4. 4
      spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

10
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/elasticsearch/ElasticsearchHealthIndicatorProperties.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@ -47,20 +47,24 @@ public class ElasticsearchHealthIndicatorProperties { @@ -47,20 +47,24 @@ public class ElasticsearchHealthIndicatorProperties {
*/
private Duration responseTimeout = Duration.ofMillis(100);
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprected")
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprecated.")
@Deprecated
public List<String> getIndices() {
return this.indices;
}
@Deprecated
public void setIndices(List<String> indices) {
this.indices = indices;
}
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprected")
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprecated.")
@Deprecated
public Duration getResponseTimeout() {
return this.responseTimeout;
}
@Deprecated
public void setResponseTimeout(Duration responseTimeout) {
this.responseTimeout = responseTimeout;
}

5
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/amqp/RabbitProperties.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@ -275,8 +275,9 @@ public class RabbitProperties { @@ -275,8 +275,9 @@ public class RabbitProperties {
this.requestedHeartbeat = requestedHeartbeat;
}
@DeprecatedConfigurationProperty(reason = "replaced to support additional confirm types",
@DeprecatedConfigurationProperty(reason = "Replaced to support additional confirm types.",
replacement = "spring.rabbitmq.publisher-confirm-type")
@Deprecated
public boolean isPublisherConfirms() {
return ConfirmType.CORRELATED.equals(this.publisherConfirmType);
}

3
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jackson/JacksonProperties.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 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.
@ -126,6 +126,7 @@ public class JacksonProperties { @@ -126,6 +126,7 @@ public class JacksonProperties {
return this.jodaDateTimeFormat;
}
@Deprecated
public void setJodaDateTimeFormat(String jodaDataTimeFormat) {
this.jodaDateTimeFormat = jodaDataTimeFormat;
}

4
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java

@ -138,12 +138,14 @@ public class ServerProperties { @@ -138,12 +138,14 @@ public class ServerProperties {
this.address = address;
}
@DeprecatedConfigurationProperty(reason = "replaced to support additional strategies",
@DeprecatedConfigurationProperty(reason = "Replaced to support additional strategies.",
replacement = "server.forward-headers-strategy")
@Deprecated
public Boolean isUseForwardHeaders() {
return ForwardHeadersStrategy.NATIVE.equals(this.forwardHeadersStrategy);
}
@Deprecated
public void setUseForwardHeaders(Boolean useForwardHeaders) {
this.forwardHeadersStrategy = Boolean.TRUE.equals(useForwardHeaders) ? ForwardHeadersStrategy.NATIVE
: ForwardHeadersStrategy.NONE;

Loading…
Cancel
Save