Populate cache in ConfigFileApplicationListener

Fix `ConfigFileApplicationListener` so that the loadDocumentsCache is
populated when documents are loaded.

Closes gh-12732
pull/12767/merge
dreis2211 7 years ago committed by Phillip Webb
parent 35b4cd01ab
commit cc66de28d0

@ -539,12 +539,12 @@ public class ConfigFileApplicationListener
private List<Document> loadDocuments(PropertySourceLoader loader, String name,
Resource resource) throws IOException {
loader.load(name, resource);
DocumentsCacheKey cacheKey = new DocumentsCacheKey(loader, resource);
List<Document> documents = this.loadDocumentsCache.get(cacheKey);
if (documents == null) {
List<PropertySource<?>> loaded = loader.load(name, resource);
documents = asDocuments(loaded);
this.loadDocumentsCache.put(cacheKey, documents);
}
return documents;
}

Loading…
Cancel
Save