Browse Source

Merge branch '1.1.x'

pull/1593/head
Phillip Webb 12 years ago
parent
commit
0468cf5a8f
  1. 3
      spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java
  2. 5
      spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java

3
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnWebApplicationCondition.java

@ -78,8 +78,7 @@ class OnWebApplicationCondition extends SpringBootCondition {
} }
if (context.getResourceLoader() instanceof WebApplicationContext) { if (context.getResourceLoader() instanceof WebApplicationContext) {
return ConditionOutcome return ConditionOutcome.match("found web application WebApplicationContext");
.match("found web application WebApplicationContext");
} }
return ConditionOutcome.noMatch("not a web application"); return ConditionOutcome.noMatch("not a web application");

5
spring-boot/src/main/java/org/springframework/boot/bind/PropertySourcesPropertyValues.java

@ -51,7 +51,7 @@ public class PropertySourcesPropertyValues implements PropertyValues {
private static final Collection<String> NON_ENUMERABLE_ENUMERABLES = Arrays.asList( private static final Collection<String> NON_ENUMERABLE_ENUMERABLES = Arrays.asList(
StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME); StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME);
/** /**
* Create a new PropertyValues from the given PropertySources * Create a new PropertyValues from the given PropertySources
* @param propertySources a PropertySources instance * @param propertySources a PropertySources instance
@ -107,7 +107,8 @@ public class PropertySourcesPropertyValues implements PropertyValues {
PropertySourcesPropertyResolver resolver, String[] includes, String[] exacts) { PropertySourcesPropertyResolver resolver, String[] includes, String[] exacts) {
if (source.getPropertyNames().length > 0) { if (source.getPropertyNames().length > 0) {
for (String propertyName : source.getPropertyNames()) { for (String propertyName : source.getPropertyNames()) {
if (PropertySourcesPropertyValues.NON_ENUMERABLE_ENUMERABLES.contains(source.getName()) if (PropertySourcesPropertyValues.NON_ENUMERABLE_ENUMERABLES
.contains(source.getName())
&& !PatternMatchUtils.simpleMatch(includes, propertyName)) { && !PatternMatchUtils.simpleMatch(includes, propertyName)) {
continue; continue;
} }

Loading…
Cancel
Save