spring-boot-project/spring-boot/src/main/java/org/springframework/boot/DefaultPropertiesPropertySource.java
/**
	 * Add a new {@link DefaultPropertiesPropertySource} or merge with an existing one.
	 * @param source the {@code Map} source
	 * @param sources the existing sources
	 * @since 2.4.4
	 */
Add a new  DefaultPropertiesPropertySource or merge with an existing one.
@param source the  Map source
@param sources the existing sources
@since 2.4.4
Add a new DefaultPropertiesPropertySource or merge with an existing one . @param source the Map source @param sources the existing sources @since 2 . 4 . 4
public static void addOrMerge(Map<String, Object> source, MutablePropertySources sources) {
		if (!CollectionUtils.isEmpty(source)) {
			Map<String, Object> resultingSource = new HashMap<>();
			DefaultPropertiesPropertySource propertySource = new DefaultPropertiesPropertySource(resultingSource);
			if (sources.contains(NAME)) {
				mergeIfPossible(source, sources, resultingSource);
				sources.replace(NAME, propertySource);
			}
			else {
				resultingSource.putAll(source);
				sources.addLast(propertySource);
			}
		}
	}
public static void addOrMerge ( Map < String , Object > source , MutablePropertySources sources ) { if ( ! CollectionUtils . isEmpty ( source ) ) { Map < String , Object > resultingSource = new HashMap < > ( ) ; DefaultPropertiesPropertySource propertySource = new DefaultPropertiesPropertySource ( resultingSource ) ; if ( sources . contains ( NAME ) ) { mergeIfPossible ( source , sources , resultingSource ) ; sources . replace ( NAME , propertySource ) ; } else { resultingSource . putAll ( source ) ; sources . addLast ( propertySource ) ; } } }
Add a new {@link DefaultPropertiesPropertySource} or merge with an existing one.
Add a new { @link DefaultPropertiesPropertySource } or merge with an existing one .