fixed regression: looking for annotation on original bean class as well, not just on exposed bean type (SPR-5981)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@1988 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-09-24 14:59:26 +00:00
parent 7f532b126d
commit 0708205690
3 changed files with 67 additions and 13 deletions
@@ -214,15 +214,14 @@ public class QualifierAnnotationAutowireCandidateResolver implements AutowireCan
}
if (targetAnnotation == null) {
// look for matching annotation on the target class
Class<?> beanType = null;
if (this.beanFactory != null) {
beanType = this.beanFactory.getType(bdHolder.getBeanName());
Class<?> beanType = this.beanFactory.getType(bdHolder.getBeanName());
if (beanType != null) {
targetAnnotation = ClassUtils.getUserClass(beanType).getAnnotation(type);
}
}
else if (bd.hasBeanClass()) {
beanType = bd.getBeanClass();
}
if (beanType != null) {
targetAnnotation = ClassUtils.getUserClass(beanType).getAnnotation(type);
if (targetAnnotation == null && bd.hasBeanClass()) {
targetAnnotation = ClassUtils.getUserClass(bd.getBeanClass()).getAnnotation(type);
}
}
if (targetAnnotation != null && targetAnnotation.equals(annotation)) {