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
This commit is contained in:
Stephane Nicoll
2020-04-19 16:35:00 +02:00
parent 1a8aa72afd
commit 90c0378a7d
4 changed files with 15 additions and 7 deletions

View File

@@ -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 {
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);
}

View File

@@ -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 {
return this.jodaDateTimeFormat;
}
@Deprecated
public void setJodaDateTimeFormat(String jodaDataTimeFormat) {
this.jodaDateTimeFormat = jodaDataTimeFormat;
}

View File

@@ -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;