File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
spring-core/src/main/java/org/springframework/core/env Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -78,9 +78,11 @@ public boolean containsProperty(String name) {
78
78
public String [] getPropertyNames () {
79
79
Set <String > names = new LinkedHashSet <String >();
80
80
for (PropertySource <?> propertySource : this .propertySources ) {
81
- if (propertySource instanceof EnumerablePropertySource ) {
82
- names .addAll (Arrays .asList (((EnumerablePropertySource <?>) propertySource ).getPropertyNames ()));
81
+ if (!(propertySource instanceof EnumerablePropertySource )) {
82
+ throw new IllegalStateException (
83
+ "Failed to enumerate property names due to non-enumerable property source: " + propertySource );
83
84
}
85
+ names .addAll (Arrays .asList (((EnumerablePropertySource <?>) propertySource ).getPropertyNames ()));
84
86
}
85
87
return StringUtils .toStringArray (names );
86
88
}
You can’t perform that action at this time.
0 commit comments