From 35b4cd01abb4deae61e2f0fc9f990dd6c9d2d355 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 4 Apr 2018 18:08:38 -0700 Subject: [PATCH 1/2] Polish --- .../java/org/springframework/boot/env/PropertySourceLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cc66de28d0eb79d3b710a110d7650bb0454a90f6 Mon Sep 17 00:00:00 2001 From: dreis2211 Date: Wed, 4 Apr 2018 18:09:08 -0700 Subject: [PATCH 2/2] 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; }