AbstractAutowireCapableBeanFactory avoids early FactoryBean instantiation on currently created configuration bean

Issue: SPR-12141
(cherry picked from commit 4432c41)
This commit is contained in:
Juergen Hoeller
2014-09-03 00:28:05 +02:00
parent 72d62a7113
commit bff2bf2cdb
3 changed files with 54 additions and 22 deletions

View File

@@ -832,7 +832,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
if (bw != null) {
return (FactoryBean<?>) bw.getWrappedInstance();
}
if (isSingletonCurrentlyInCreation(beanName)) {
if (isSingletonCurrentlyInCreation(beanName) ||
(mbd.getFactoryBeanName() != null && isSingletonCurrentlyInCreation(mbd.getFactoryBeanName()))) {
return null;
}
Object instance = null;