ResolvableType.forRawClass as a straight wrapper for Class.isAssignableFrom
Issue: SPR-12846
This commit is contained in:
@@ -561,7 +561,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
|
||||
@Override
|
||||
public boolean isTypeMatch(String name, Class<?> typeToMatch) throws NoSuchBeanDefinitionException {
|
||||
return isTypeMatch(name, ResolvableType.forClass(typeToMatch != null ? typeToMatch : Object.class));
|
||||
return isTypeMatch(name, ResolvableType.forRawClass(typeToMatch));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -412,8 +412,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
@Override
|
||||
public String[] getBeanNamesForType(Class<?> type, boolean includeNonSingletons, boolean allowEagerInit) {
|
||||
if (!isConfigurationFrozen() || type == null || !allowEagerInit) {
|
||||
return doGetBeanNamesForType(ResolvableType.forClass(type != null ? type : Object.class),
|
||||
includeNonSingletons, allowEagerInit);
|
||||
return doGetBeanNamesForType(ResolvableType.forRawClass(type), includeNonSingletons, allowEagerInit);
|
||||
}
|
||||
Map<Class<?>, String[]> cache =
|
||||
(includeNonSingletons ? this.allBeanNamesByType : this.singletonBeanNamesByType);
|
||||
@@ -421,7 +420,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||
if (resolvedBeanNames != null) {
|
||||
return resolvedBeanNames;
|
||||
}
|
||||
resolvedBeanNames = doGetBeanNamesForType(ResolvableType.forClass(type), includeNonSingletons, allowEagerInit);
|
||||
resolvedBeanNames = doGetBeanNamesForType(ResolvableType.forRawClass(type), includeNonSingletons, true);
|
||||
if (ClassUtils.isCacheSafe(type, getBeanClassLoader())) {
|
||||
cache.put(type, resolvedBeanNames);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user