diff --git a/spring-boot-tools/spring-boot-loader-tools/.gitignore b/spring-boot-tools/spring-boot-loader-tools/.gitignore deleted file mode 100644 index ea8c4bf7f3..0000000000 --- a/spring-boot-tools/spring-boot-loader-tools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target 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 55c0cb57fe..bc7013e2b7 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 @@ -100,7 +100,7 @@ public class PropertySourcesPropertyValues implements PropertyValues { // that's better than nothing... for (String propertyName : exacts) { Object value; - value = source.getProperty(propertyName); + value = resolver.getProperty(propertyName); if (value != null && !this.propertyValues.containsKey(propertyName)) { this.propertyValues.put(propertyName, new PropertyValue( propertyName, value)); diff --git a/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java b/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java index 2d29eec36e..50be81c3db 100644 --- a/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/bind/PropertySourcesPropertyValuesTests.java @@ -73,6 +73,23 @@ public class PropertySourcesPropertyValuesTests { assertEquals("bar", propertyValues.getPropertyValue("name").getValue()); } + @Test + public void testNonEnumeratedPlaceholder() { + this.propertySources.addFirst(new PropertySource("another", "baz") { + @Override + public Object getProperty(String name) { + if (name.equals(getSource())) { + return "${foo}"; + } + return null; + } + + }); + PropertySourcesPropertyValues propertyValues = new PropertySourcesPropertyValues( + this.propertySources, null, Collections.singleton("baz")); + assertEquals("bar", propertyValues.getPropertyValue("baz").getValue()); + } + @Test public void testOverriddenValue() { this.propertySources.addFirst(new MapPropertySource("new", Collections