Consistent ordering for @PropertySource locations
Ensure that property source locations are processed in the same order regardless if the 'name' attribute is set or not. Prior to this commit multiple locations from a `@PropertySource` with a name were added to a `CompositePropertySource` in such a way that the first location would take precedence. This has now been reversed for consistence with unnamed `@PropertySource`s Issue: SPR-10820
This commit is contained in:
@@ -320,8 +320,8 @@ class ConfigurationClassParser {
|
||||
}
|
||||
else {
|
||||
CompositePropertySource ps = new CompositePropertySource(name);
|
||||
for (String location : locations) {
|
||||
ps.addPropertySource(new ResourcePropertySource(location, classLoader));
|
||||
for (int i = locations.length - 1; i >= 0; i--) {
|
||||
ps.addPropertySource(new ResourcePropertySource(locations[i], classLoader));
|
||||
}
|
||||
this.propertySources.push(ps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user