Browse Source

Avoid duplicate class introspection during findAnnotationOnBean

Closes gh-22318
pull/22392/head
Juergen Hoeller 6 years ago
parent
commit
ca7634dfe8
  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

@ -677,7 +677,10 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto @@ -677,7 +677,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