mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
lenientConstructorResolution flag applies to factory methods as well
This commit is contained in:
+6
@@ -443,6 +443,12 @@ class ConstructorResolver {
|
||||
argsToUse = args.arguments;
|
||||
minTypeDiffWeight = typeDiffWeight;
|
||||
}
|
||||
else if (typeDiffWeight < Integer.MAX_VALUE && typeDiffWeight == minTypeDiffWeight &&
|
||||
!mbd.isLenientConstructorResolution()) {
|
||||
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
|
||||
"Ambiguous factory method matches found in bean '" + beanName + "' " +
|
||||
"(hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user