|
|
|
@ -23,8 +23,8 @@ import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Default implementation of the {@link PropertySources} interface. |
|
|
|
* Default implementation of the {@link PropertySources} interface. |
|
|
|
* Allows manipulation of contained property sources and provides constructor |
|
|
|
* Allows manipulation of contained property sources and provides a constructor |
|
|
|
* to copying an existing {@code PropertySources} instance. |
|
|
|
* for copying an existing {@code PropertySources} instance. |
|
|
|
* |
|
|
|
* |
|
|
|
* <p>Where <em>precedence</em> is mentioned in methods such as {@link #addFirst} |
|
|
|
* <p>Where <em>precedence</em> is mentioned in methods such as {@link #addFirst} |
|
|
|
* and {@link #addLast}, this is with regard to the order in which property sources |
|
|
|
* and {@link #addLast}, this is with regard to the order in which property sources |
|
|
|
@ -41,7 +41,6 @@ public class MutablePropertySources implements PropertySources { |
|
|
|
|
|
|
|
|
|
|
|
private final LinkedList<PropertySource<?>> propertySourceList = new LinkedList<PropertySource<?>>(); |
|
|
|
private final LinkedList<PropertySource<?>> propertySourceList = new LinkedList<PropertySource<?>>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new {@link MutablePropertySources} object. |
|
|
|
* Create a new {@link MutablePropertySources} object. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ -105,7 +104,7 @@ public class MutablePropertySources implements PropertySources { |
|
|
|
assertLegalRelativeAddition(relativePropertySourceName, propertySource); |
|
|
|
assertLegalRelativeAddition(relativePropertySourceName, propertySource); |
|
|
|
removeIfPresent(propertySource); |
|
|
|
removeIfPresent(propertySource); |
|
|
|
int index = assertPresentAndGetIndex(relativePropertySourceName); |
|
|
|
int index = assertPresentAndGetIndex(relativePropertySourceName); |
|
|
|
addAtIndex(index+1, propertySource); |
|
|
|
addAtIndex(index + 1, propertySource); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
|