Skip to content

Commit 90c0378

Browse files
committed
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
1 parent 1a8aa72 commit 90c0378

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,20 +47,24 @@ public class ElasticsearchHealthIndicatorProperties {
4747
*/
4848
private Duration responseTimeout = Duration.ofMillis(100);
4949

50-
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprected")
50+
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprecated.")
51+
@Deprecated
5152
public List<String> getIndices() {
5253
return this.indices;
5354
}
5455

56+
@Deprecated
5557
public void setIndices(List<String> indices) {
5658
this.indices = indices;
5759
}
5860

59-
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprected")
61+
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprecated.")
62+
@Deprecated
6063
public Duration getResponseTimeout() {
6164
return this.responseTimeout;
6265
}
6366

67+
@Deprecated
6468
public void setResponseTimeout(Duration responseTimeout) {
6569
this.responseTimeout = responseTimeout;
6670
}

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -275,8 +275,9 @@ public void setRequestedHeartbeat(Duration requestedHeartbeat) {
275275
this.requestedHeartbeat = requestedHeartbeat;
276276
}
277277

278-
@DeprecatedConfigurationProperty(reason = "replaced to support additional confirm types",
278+
@DeprecatedConfigurationProperty(reason = "Replaced to support additional confirm types.",
279279
replacement = "spring.rabbitmq.publisher-confirm-type")
280+
@Deprecated
280281
public boolean isPublisherConfirms() {
281282
return ConfirmType.CORRELATED.equals(this.publisherConfirmType);
282283
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -126,6 +126,7 @@ public String getJodaDateTimeFormat() {
126126
return this.jodaDateTimeFormat;
127127
}
128128

129+
@Deprecated
129130
public void setJodaDateTimeFormat(String jodaDataTimeFormat) {
130131
this.jodaDateTimeFormat = jodaDataTimeFormat;
131132
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ public void setAddress(InetAddress address) {
138138
this.address = address;
139139
}
140140

141-
@DeprecatedConfigurationProperty(reason = "replaced to support additional strategies",
141+
@DeprecatedConfigurationProperty(reason = "Replaced to support additional strategies.",
142142
replacement = "server.forward-headers-strategy")
143+
@Deprecated
143144
public Boolean isUseForwardHeaders() {
144145
return ForwardHeadersStrategy.NATIVE.equals(this.forwardHeadersStrategy);
145146
}
146147

148+
@Deprecated
147149
public void setUseForwardHeaders(Boolean useForwardHeaders) {
148150
this.forwardHeadersStrategy = Boolean.TRUE.equals(useForwardHeaders) ? ForwardHeadersStrategy.NATIVE
149151
: ForwardHeadersStrategy.NONE;

0 commit comments

Comments
 (0)