Skip to content

Commit cc66de2

Browse files
dreis2211philwebb
authored andcommitted
Populate cache in ConfigFileApplicationListener
Fix `ConfigFileApplicationListener` so that the loadDocumentsCache is populated when documents are loaded. Closes gh-12732
1 parent 35b4cd0 commit cc66de2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ private void load(PropertySourceLoader loader, String location, Profile profile,
539539

540540
private List<Document> loadDocuments(PropertySourceLoader loader, String name,
541541
Resource resource) throws IOException {
542-
loader.load(name, resource);
543542
DocumentsCacheKey cacheKey = new DocumentsCacheKey(loader, resource);
544543
List<Document> documents = this.loadDocumentsCache.get(cacheKey);
545544
if (documents == null) {
546545
List<PropertySource<?>> loaded = loader.load(name, resource);
547546
documents = asDocuments(loaded);
547+
this.loadDocumentsCache.put(cacheKey, documents);
548548
}
549549
return documents;
550550
}

0 commit comments

Comments
 (0)