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
(cherry picked from commit e3d3d8cd)
This commit is contained in:
@@ -306,8 +306,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