From 5405c07d26db564cb680c713dce5abb859635147 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 13 Sep 2016 21:47:32 +0200 Subject: [PATCH] Configuration class processing uses MetadataReaderFactory for current ResourceLoader Issue: SPR-14684 --- .../context/annotation/ConfigurationClassPostProcessor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java index f6f4ac12f1..ede461350b 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java @@ -205,6 +205,9 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo public void setResourceLoader(ResourceLoader resourceLoader) { Assert.notNull(resourceLoader, "ResourceLoader must not be null"); this.resourceLoader = resourceLoader; + if (!this.setMetadataReaderFactoryCalled) { + this.metadataReaderFactory = new CachingMetadataReaderFactory(resourceLoader); + } } @Override