Browse Source

Avoid duplicate class introspection during findAnnotationOnBean

Closes gh-22318

(cherry picked from commit ca7634dfe8)
pull/22521/head
Juergen Hoeller 6 years ago
parent
commit
4b6558c7e5
  1. 5
      spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

5
spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

@ -584,7 +584,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -584,7 +584,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
if (bd instanceof AbstractBeanDefinition) {
AbstractBeanDefinition abd = (AbstractBeanDefinition) bd;
if (abd.hasBeanClass()) {
ann = AnnotationUtils.findAnnotation(abd.getBeanClass(), annotationType);
Class<?> beanClass = abd.getBeanClass();
if (beanClass != beanType) {
ann = AnnotationUtils.findAnnotation(beanClass, annotationType);
}
}
}
}

Loading…
Cancel
Save