Add fast path for ClassUtils.hasMethod()

This commit is contained in:
stsypanov
2019-12-30 17:20:07 +02:00
committed by Juergen Hoeller
parent c562c3a0b3
commit 8e5cad2af3
5 changed files with 33 additions and 12 deletions

View File

@@ -97,7 +97,7 @@ abstract class AutowireUtils {
// It was declared by CGLIB, but we might still want to autowire it
// if it was actually declared by the superclass.
Class<?> superclass = wm.getDeclaringClass().getSuperclass();
return !ClassUtils.hasMethod(superclass, wm.getName(), wm.getParameterTypes());
return !ClassUtils.hasMethod(superclass, wm);
}
/**
@@ -112,8 +112,7 @@ abstract class AutowireUtils {
if (setter != null) {
Class<?> targetClass = setter.getDeclaringClass();
for (Class<?> ifc : interfaces) {
if (ifc.isAssignableFrom(targetClass) &&
ClassUtils.hasMethod(ifc, setter.getName(), setter.getParameterTypes())) {
if (ifc.isAssignableFrom(targetClass) && ClassUtils.hasMethod(ifc, setter)) {
return true;
}
}