Restored isTypeMatch null behavior and refined typeToMatch parameter name

Issue: SPR-12147
This commit is contained in:
Juergen Hoeller
2015-03-23 21:57:03 +01:00
parent 44e8f7b333
commit b2308926bc
8 changed files with 63 additions and 28 deletions

View File

@@ -1025,15 +1025,15 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
}
@Override
public boolean isTypeMatch(String name, ResolvableType targetType) throws NoSuchBeanDefinitionException {
public boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuchBeanDefinitionException {
assertBeanFactoryActive();
return getBeanFactory().isTypeMatch(name, targetType);
return getBeanFactory().isTypeMatch(name, typeToMatch);
}
@Override
public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException {
public boolean isTypeMatch(String name, Class<?> typeToMatch) throws NoSuchBeanDefinitionException {
assertBeanFactoryActive();
return getBeanFactory().isTypeMatch(name, targetType);
return getBeanFactory().isTypeMatch(name, typeToMatch);
}
@Override

View File

@@ -174,15 +174,15 @@ public class SimpleJndiBeanFactory extends JndiLocatorSupport implements BeanFac
}
@Override
public boolean isTypeMatch(String name, ResolvableType targetType) throws NoSuchBeanDefinitionException {
public boolean isTypeMatch(String name, ResolvableType typeToMatch) throws NoSuchBeanDefinitionException {
Class<?> type = getType(name);
return (targetType == null || (type != null && targetType.isAssignableFrom(type)));
return (type != null && typeToMatch.isAssignableFrom(type));
}
@Override
public boolean isTypeMatch(String name, Class<?> targetType) throws NoSuchBeanDefinitionException {
public boolean isTypeMatch(String name, Class<?> typeToMatch) throws NoSuchBeanDefinitionException {
Class<?> type = getType(name);
return (targetType == null || (type != null && targetType.isAssignableFrom(type)));
return (typeToMatch == null || (type != null && typeToMatch.isAssignableFrom(type)));
}
@Override