Refined predictBeanType's typesToMatch check for FactoryBeans
GroovyScriptFactoryTests passes again now. Issue: SPR-10304
This commit is contained in:
parent
9929182e30
commit
e0c7571a41
|
@ -582,11 +582,10 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
|||
for (BeanPostProcessor bp : getBeanPostProcessors()) {
|
||||
if (bp instanceof SmartInstantiationAwareBeanPostProcessor) {
|
||||
SmartInstantiationAwareBeanPostProcessor ibp = (SmartInstantiationAwareBeanPostProcessor) bp;
|
||||
Class predictedType = ibp.predictBeanType(beanClass, beanName);
|
||||
if (predictedType != null && (typesToMatch.length > 1 ||
|
||||
(typesToMatch.length > 0 && !FactoryBean.class.equals(typesToMatch[0])) ||
|
||||
FactoryBean.class.isAssignableFrom(predictedType))) {
|
||||
return predictedType;
|
||||
Class predicted = ibp.predictBeanType(beanClass, beanName);
|
||||
if (predicted != null && (typesToMatch.length != 1 || !FactoryBean.class.equals(typesToMatch[0]) ||
|
||||
FactoryBean.class.isAssignableFrom(predicted))) {
|
||||
return predicted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue