From 834aa09300b4ed6f75f0841fc35836b6f4f9944e Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 25 Apr 2017 11:30:27 -0700 Subject: [PATCH] Remove ConfigurationProperySource Remove `ConfigurationProperySource` from `PropertySourcesPropertyValues` so that the deprecated code to continues to work. See gh-4910 --- .../boot/bind/PropertySourcesPropertyValues.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java index 1fb4cc29ec..a7a7c4632d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java +++ b/spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java @@ -25,8 +25,10 @@ import java.util.regex.Pattern; import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.PropertyValue; import org.springframework.beans.PropertyValues; +import org.springframework.boot.context.properties.source.ConfigurationPropertySources; import org.springframework.core.env.CompositePropertySource; import org.springframework.core.env.EnumerablePropertySource; +import org.springframework.core.env.MutablePropertySources; import org.springframework.core.env.PropertySource; import org.springframework.core.env.PropertySources; import org.springframework.core.env.PropertySourcesPropertyResolver; @@ -108,6 +110,10 @@ public class PropertySourcesPropertyValues implements PropertyValues { PropertyNamePatternsMatcher includes, boolean resolvePlaceholders) { Assert.notNull(propertySources, "PropertySources must not be null"); Assert.notNull(includes, "Includes must not be null"); + MutablePropertySources mutablePropertySources = new MutablePropertySources( + propertySources); + mutablePropertySources.remove(ConfigurationPropertySources.PROPERTY_SOURCE_NAME); + propertySources = mutablePropertySources; this.propertySources = propertySources; this.nonEnumerableFallbackNames = nonEnumerableFallbackNames; this.includes = includes;