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 13:48:47 +02:00
parent 3b64db18f7
commit 5da8a16284
3 changed files with 89 additions and 45 deletions

View File

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