Ignore overridden factory methods for unique candidate resolution

See gh-27920
This commit is contained in:
Juergen Hoeller
2022-10-06 15:06:53 +02:00
parent 455a736a01
commit 6027be5a39
2 changed files with 25 additions and 4 deletions

View File

@@ -371,7 +371,7 @@ class ConstructorResolver {
*/
private Method[] getCandidateMethods(Class<?> factoryClass, RootBeanDefinition mbd) {
return (mbd.isNonPublicAccessAllowed() ?
ReflectionUtils.getAllDeclaredMethods(factoryClass) : factoryClass.getMethods());
ReflectionUtils.getUniqueDeclaredMethods(factoryClass) : factoryClass.getMethods());
}
private boolean isStaticCandidate(Method method, Class<?> factoryClass) {