@ -24,6 +24,7 @@ import java.util.Set;
@@ -24,6 +24,7 @@ import java.util.Set;
import org.springframework.beans.SimpleTypeConverter ;
import org.springframework.beans.TypeConverter ;
import org.springframework.beans.factory.NoSuchBeanDefinitionException ;
import org.springframework.beans.factory.config.BeanDefinitionHolder ;
import org.springframework.beans.factory.config.DependencyDescriptor ;
import org.springframework.beans.factory.support.AutowireCandidateQualifier ;
@ -53,7 +54,7 @@ import org.springframework.util.StringUtils;
@@ -53,7 +54,7 @@ import org.springframework.util.StringUtils;
* /
public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwareAutowireCandidateResolver {
private final Set < Class < ? extends Annotation > > qualifierTypes = new LinkedHashSet < Class < ? extends Annotation > > ( ) ;
private final Set < Class < ? extends Annotation > > qualifierTypes = new LinkedHashSet < Class < ? extends Annotation > > ( 2 ) ;
private Class < ? extends Annotation > valueAnnotationType = Value . class ;
@ -67,8 +68,8 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa
@@ -67,8 +68,8 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa
public QualifierAnnotationAutowireCandidateResolver ( ) {
this . qualifierTypes . add ( Qualifier . class ) ;
try {
this . qualifierTypes . add ( ( Class < ? extends Annotation > )
ClassUtils . forName ( "javax.inject.Qualifier" , QualifierAnnotationAutowireCandidateResolver . class . getClassLoader ( ) ) ) ;
this . qualifierTypes . add ( ( Class < ? extends Annotation > ) ClassUtils . forName ( "javax.inject.Qualifier" ,
QualifierAnnotationAutowireCandidateResolver . class . getClassLoader ( ) ) ) ;
}
catch ( ClassNotFoundException ex ) {
// JSR-330 API not available - simply skip.
@ -233,9 +234,14 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa
@@ -233,9 +234,14 @@ public class QualifierAnnotationAutowireCandidateResolver extends GenericTypeAwa
if ( targetAnnotation = = null ) {
// Look for matching annotation on the target class
if ( getBeanFactory ( ) ! = null ) {
Class < ? > beanType = getBeanFactory ( ) . getType ( bdHolder . getBeanName ( ) ) ;
if ( beanType ! = null ) {
targetAnnotation = AnnotationUtils . getAnnotation ( ClassUtils . getUserClass ( beanType ) , type ) ;
try {
Class < ? > beanType = getBeanFactory ( ) . getType ( bdHolder . getBeanName ( ) ) ;
if ( beanType ! = null ) {
targetAnnotation = AnnotationUtils . getAnnotation ( ClassUtils . getUserClass ( beanType ) , type ) ;
}
}
catch ( NoSuchBeanDefinitionException ex ) {
// Not the usual case - simply forget about the type check...
}
}
if ( targetAnnotation = = null & & bd . hasBeanClass ( ) ) {