From b8dc4e74e47d16b5d6826bcddb01f75e652d0f23 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 9 Mar 2016 17:17:25 +0100 Subject: [PATCH] Deprecate ConfigurationProperties#location Closes gh-5129 --- .../boot/context/properties/ConfigurationProperties.java | 4 ++++ .../ConfigurationPropertiesBindingPostProcessor.java | 1 + 2 files changed, 5 insertions(+) diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java index 1f00a27ea98..c142d41dda0 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationProperties.java @@ -90,7 +90,9 @@ public @interface ConfigurationProperties { * defined in the environment. * @return the path (or paths) of resources to bind to * @see #merge() + * @deprecated configure the environment with those additional locations instead */ + @Deprecated String[] locations() default {}; /** @@ -98,7 +100,9 @@ public @interface ConfigurationProperties { * merged with the default configuration. * @return the flag value (default true) * @see #locations() + * @deprecated as {@link #locations()} is deprecated as well */ + @Deprecated boolean merge() default true; } diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index 3b8f7a318fd..e6b7b4047ab 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -302,6 +302,7 @@ public class ConfigurationPropertiesBindingPostProcessor return bean; } + @SuppressWarnings("deprecation") private void postProcessBeforeInitialization(Object bean, String beanName, ConfigurationProperties annotation) { Object target = bean;