diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index e7b54495fc..6ca646c5c0 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -539,12 +539,12 @@ public class ConfigFileApplicationListener private List loadDocuments(PropertySourceLoader loader, String name, Resource resource) throws IOException { - loader.load(name, resource); DocumentsCacheKey cacheKey = new DocumentsCacheKey(loader, resource); List documents = this.loadDocumentsCache.get(cacheKey); if (documents == null) { List> loaded = loader.load(name, resource); documents = asDocuments(loaded); + this.loadDocumentsCache.put(cacheKey, documents); } return documents; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/PropertySourceLoader.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/PropertySourceLoader.java index 09ea77e86e..5bb1139c5e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/PropertySourceLoader.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/PropertySourceLoader.java @@ -41,7 +41,7 @@ public interface PropertySourceLoader { /** * Load the resource into one or more property sources. Implementations may either * return a list containing a single source, or in the case of a multi-document format - * such as yaml a source or each document in the resource. + * such as yaml a source for each document in the resource. * @param name the root name of the property source. If multiple documents are loaded * an additional suffix should be added to the name for each source loaded. * @param resource the resource to load