Avoid repeated assignability check for raw class on fallback match, since AutowireCandidateResolver is only being called for basic type matches to begin with

Issue: SPR-9965
This commit is contained in:
Juergen Hoeller 2014-02-01 19:28:40 +01:00
parent 874a2a9ca2
commit f27304d785
1 changed files with 2 additions and 4 deletions

View File

@ -106,12 +106,10 @@ public class GenericTypeAwareAutowireCandidateResolver implements AutowireCandid
}
}
}
if (targetType == null) {
if (targetType == null || (descriptor.fallbackMatchAllowed() && targetType.hasUnresolvableGenerics())) {
return true;
}
if (descriptor.fallbackMatchAllowed() && targetType.hasUnresolvableGenerics()) {
return descriptor.getDependencyType().isAssignableFrom(targetType.getRawClass());
}
// Full check for complex generic type match...
return dependencyType.isAssignableFrom(targetType);
}