AbstractAutowireCapableBeanFactory avoids early FactoryBean instantiation on currently created configuration bean

Issue: SPR-12141
This commit is contained in:
Juergen Hoeller
2014-09-03 00:28:05 +02:00
parent 1f6c40fd86
commit 4432c41dbd
3 changed files with 50 additions and 21 deletions

View File

@@ -847,7 +847,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;