From cc66de28d0eb79d3b710a110d7650bb0454a90f6 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 4 Apr 2018 18:09:08 -0700 Subject: [PATCH] Populate cache in ConfigFileApplicationListener Fix `ConfigFileApplicationListener` so that the loadDocumentsCache is populated when documents are loaded. Closes gh-12732 --- .../boot/context/config/ConfigFileApplicationListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }