fixed decorated BeanDefinition condition for early type checking in AbstractBeanFactory (SPR-7006)

This commit is contained in:
Juergen Hoeller
2010-03-31 15:21:48 +00:00
parent 20f4e9023b
commit 092241a632
3 changed files with 10 additions and 6 deletions

View File

@@ -480,7 +480,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// Check decorated bean definition, if any: We assume it'll be easier
// to determine the decorated bean's type than the proxy's type.
BeanDefinitionHolder dbd = mbd.getDecoratedDefinition();
if (dbd != null) {
if (dbd != null && !BeanFactoryUtils.isFactoryDereference(name)) {
RootBeanDefinition tbd = getMergedBeanDefinition(dbd.getBeanName(), dbd.getBeanDefinition(), mbd);
Class targetClass = predictBeanType(dbd.getBeanName(), tbd, FactoryBean.class, typeToMatch);
if (targetClass != null && !FactoryBean.class.isAssignableFrom(targetClass)) {