提交 7ac665b1 编写于 作者: J Juergen Hoeller

Polishing

上级 765d43b3
...@@ -823,9 +823,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac ...@@ -823,9 +823,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* it will be fully created to check the type of its exposed object. * it will be fully created to check the type of its exposed object.
*/ */
@Override @Override
protected ResolvableType getTypeForFactoryBean(String beanName, protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefinition mbd, boolean allowInit) {
RootBeanDefinition mbd, boolean allowInit) {
// Check if the bean definition itself has defined the type with an attribute // Check if the bean definition itself has defined the type with an attribute
ResolvableType result = getTypeForFactoryBeanFromAttributes(mbd); ResolvableType result = getTypeForFactoryBeanFromAttributes(mbd);
if (result != ResolvableType.NONE) { if (result != ResolvableType.NONE) {
...@@ -858,14 +856,14 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac ...@@ -858,14 +856,14 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// Try to obtain the FactoryBean's object type from its factory method // Try to obtain the FactoryBean's object type from its factory method
// declaration without instantiating the containing bean at all. // declaration without instantiating the containing bean at all.
BeanDefinition factoryBeanDefinition = getBeanDefinition(factoryBeanName); BeanDefinition factoryBeanDefinition = getBeanDefinition(factoryBeanName);
Class<?> factoryBeanClass = null; Class<?> factoryBeanClass;
if (factoryBeanDefinition instanceof AbstractBeanDefinition if (factoryBeanDefinition instanceof AbstractBeanDefinition &&
&& ((AbstractBeanDefinition) factoryBeanDefinition).hasBeanClass()) { ((AbstractBeanDefinition) factoryBeanDefinition).hasBeanClass()) {
factoryBeanClass = ((AbstractBeanDefinition) factoryBeanDefinition).getBeanClass(); factoryBeanClass = ((AbstractBeanDefinition) factoryBeanDefinition).getBeanClass();
} }
else { else {
RootBeanDefinition fbmbd = getMergedBeanDefinition(factoryBeanName, factoryBeanDefinition); RootBeanDefinition fbmbd = getMergedBeanDefinition(factoryBeanName, factoryBeanDefinition);
factoryBeanClass = determineTargetType(factoryBeanName, fbmbd, new Class<?>[] { Object.class }); factoryBeanClass = determineTargetType(factoryBeanName, fbmbd);
} }
if (factoryBeanClass != null) { if (factoryBeanClass != null) {
result = getTypeForFactoryBeanFromMethod(factoryBeanClass, factoryMethodName); result = getTypeForFactoryBeanFromMethod(factoryBeanClass, factoryMethodName);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册