Commit 90c0378a authored by Stephane Nicoll's avatar Stephane Nicoll

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
parent 1a8aa72a
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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); 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() { public List<String> getIndices() {
return this.indices; return this.indices;
} }
@Deprecated
public void setIndices(List<String> indices) { public void setIndices(List<String> indices) {
this.indices = indices; this.indices = indices;
} }
@DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprected") @DeprecatedConfigurationProperty(reason = "Upstream elasticsearch transport is deprecated.")
@Deprecated
public Duration getResponseTimeout() { public Duration getResponseTimeout() {
return this.responseTimeout; return this.responseTimeout;
} }
@Deprecated
public void setResponseTimeout(Duration responseTimeout) { public void setResponseTimeout(Duration responseTimeout) {
this.responseTimeout = responseTimeout; this.responseTimeout = responseTimeout;
} }
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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; 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") replacement = "spring.rabbitmq.publisher-confirm-type")
@Deprecated
public boolean isPublisherConfirms() { public boolean isPublisherConfirms() {
return ConfirmType.CORRELATED.equals(this.publisherConfirmType); return ConfirmType.CORRELATED.equals(this.publisherConfirmType);
} }
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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; return this.jodaDateTimeFormat;
} }
@Deprecated
public void setJodaDateTimeFormat(String jodaDataTimeFormat) { public void setJodaDateTimeFormat(String jodaDataTimeFormat) {
this.jodaDateTimeFormat = jodaDataTimeFormat; this.jodaDateTimeFormat = jodaDataTimeFormat;
} }
......
...@@ -138,12 +138,14 @@ public class ServerProperties { ...@@ -138,12 +138,14 @@ public class ServerProperties {
this.address = address; this.address = address;
} }
@DeprecatedConfigurationProperty(reason = "replaced to support additional strategies", @DeprecatedConfigurationProperty(reason = "Replaced to support additional strategies.",
replacement = "server.forward-headers-strategy") replacement = "server.forward-headers-strategy")
@Deprecated
public Boolean isUseForwardHeaders() { public Boolean isUseForwardHeaders() {
return ForwardHeadersStrategy.NATIVE.equals(this.forwardHeadersStrategy); return ForwardHeadersStrategy.NATIVE.equals(this.forwardHeadersStrategy);
} }
@Deprecated
public void setUseForwardHeaders(Boolean useForwardHeaders) { public void setUseForwardHeaders(Boolean useForwardHeaders) {
this.forwardHeadersStrategy = Boolean.TRUE.equals(useForwardHeaders) ? ForwardHeadersStrategy.NATIVE this.forwardHeadersStrategy = Boolean.TRUE.equals(useForwardHeaders) ? ForwardHeadersStrategy.NATIVE
: ForwardHeadersStrategy.NONE; : ForwardHeadersStrategy.NONE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment