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; }