Merge branch '1.3.x'

This commit is contained in:
Phillip Webb
2016-08-29 15:30:30 +01:00
4 changed files with 17 additions and 10 deletions

View File

@@ -138,13 +138,17 @@ abstract class BeanTypeRegistry {
.getBeanDefinition(definition.getFactoryBeanName());
Class<?> factoryClass = ClassUtils.forName(factoryDefinition.getBeanClassName(),
beanFactory.getBeanClassLoader());
return getFactoryMethod(definition, factoryClass);
}
private Method getFactoryMethod(BeanDefinition definition, Class<?> factoryClass) {
Method uniqueMethod = null;
for (Method candidate : getCandidateFactoryMethods(definition, factoryClass)) {
if (candidate.getName().equals(definition.getFactoryMethodName())) {
if (uniqueMethod == null) {
uniqueMethod = candidate;
}
else if (!matchingArguments(candidate, uniqueMethod)) {
else if (!hasMatchingParameterTypes(candidate, uniqueMethod)) {
return null;
}
}
@@ -164,7 +168,7 @@ abstract class BeanTypeRegistry {
&& ((AbstractBeanDefinition) definition).isNonPublicAccessAllowed();
}
private boolean matchingArguments(Method candidate, Method current) {
private boolean hasMatchingParameterTypes(Method candidate, Method current) {
return Arrays.equals(candidate.getParameterTypes(), current.getParameterTypes());
}