@ -843,10 +843,17 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
@@ -843,10 +843,17 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* /
@Override
protected ResolvableType getTypeForFactoryBean ( String beanName , RootBeanDefinition mbd , boolean allowInit ) {
ResolvableType result ;
// Check if the bean definition itself has defined the type with an attribute
ResolvableType result = getTypeForFactoryBeanFromAttributes ( mbd ) ;
if ( result ! = ResolvableType . NONE ) {
return result ;
try {
result = getTypeForFactoryBeanFromAttributes ( mbd ) ;
if ( result ! = ResolvableType . NONE ) {
return result ;
}
}
catch ( IllegalArgumentException ex ) {
throw new BeanDefinitionStoreException ( mbd . getResourceDescription ( ) , beanName , ex . getMessage ( ) ) ;
}
// For instance supplied beans, try the target type and bean class immediately