|
|
|
@ -658,12 +658,6 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Find a {@link Annotation} of {@code annotationType} on the specified |
|
|
|
|
|
|
|
* bean, traversing its interfaces and super classes if no annotation can be |
|
|
|
|
|
|
|
* found on the given class itself, as well as checking its raw bean class
|
|
|
|
|
|
|
|
* if not found on the exposed bean reference (e.g. in case of a proxy). |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Nullable |
|
|
|
@Nullable |
|
|
|
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) |
|
|
|
public <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType) |
|
|
|
@ -686,6 +680,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
} |
|
|
|
} |
|
|
|
if (containsBeanDefinition(beanName)) { |
|
|
|
if (containsBeanDefinition(beanName)) { |
|
|
|
RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName); |
|
|
|
RootBeanDefinition bd = getMergedLocalBeanDefinition(beanName); |
|
|
|
|
|
|
|
// Check raw bean class, e.g. in case of a proxy.
|
|
|
|
if (bd.hasBeanClass()) { |
|
|
|
if (bd.hasBeanClass()) { |
|
|
|
Class<?> beanClass = bd.getBeanClass(); |
|
|
|
Class<?> beanClass = bd.getBeanClass(); |
|
|
|
if (beanClass != beanType) { |
|
|
|
if (beanClass != beanType) { |
|
|
|
@ -696,6 +691,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Check annotations declared on factory method, if any.
|
|
|
|
Method factoryMethod = bd.getResolvedFactoryMethod(); |
|
|
|
Method factoryMethod = bd.getResolvedFactoryMethod(); |
|
|
|
if (factoryMethod != null) { |
|
|
|
if (factoryMethod != null) { |
|
|
|
MergedAnnotation<A> annotation = |
|
|
|
MergedAnnotation<A> annotation = |
|
|
|
|