Remove ConfigurationProperySource

Remove `ConfigurationProperySource` from `PropertySourcesPropertyValues`
so that the deprecated code to continues to work.

See gh-4910
pull/8802/merge
Phillip Webb 8 years ago
parent 16f9ef4f6a
commit 834aa09300

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

Loading…
Cancel
Save