Skip to content

Commit

Permalink
Apply configuration properties deprecation consistently
Browse files Browse the repository at this point in the history
This commit makes sure that both the getter and the setter of a
deprecated configuration properties is flagged with `@Deprecated`.

Closes gh-20812
  • Loading branch information
snicoll committed Apr 19, 2020
1 parent 1a8aa72 commit 90c0378
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
@@ -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.
Expand Down Expand Up @@ -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;
}
Expand Down
@@ -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.
Expand Down Expand Up @@ -275,8 +275,9 @@ public void setRequestedHeartbeat(Duration 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")
@Deprecated
public boolean isPublisherConfirms() {
return ConfirmType.CORRELATED.equals(this.publisherConfirmType);
}
Expand Down
@@ -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.
Expand Down Expand Up @@ -126,6 +126,7 @@ public String getJodaDateTimeFormat() {
return this.jodaDateTimeFormat;
}

@Deprecated
public void setJodaDateTimeFormat(String jodaDataTimeFormat) {
this.jodaDateTimeFormat = jodaDataTimeFormat;
}
Expand Down
Expand Up @@ -138,12 +138,14 @@ public void setAddress(InetAddress address) {
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;
Expand Down

0 comments on commit 90c0378

Please sign in to comment.