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

@@ -207,7 +207,7 @@ public class InterfaceBasedMBeanInfoAssembler extends AbstractConfigurableMBeanI
* configured interfaces and is public, otherwise {@code false}.
*/
private boolean isPublicInInterface(Method method, String beanKey) {
return ((method.getModifiers() & Modifier.PUBLIC) > 0) && isDeclaredInInterface(method, beanKey);
return Modifier.isPublic(method.getModifiers()) && isDeclaredInInterface(method, beanKey);
}
/**

View File

@@ -145,7 +145,7 @@ public class MethodValidationInterceptor implements MethodInterceptor {
factoryBeanType = FactoryBean.class;
}
return (factoryBeanType != null && !method.getName().equals("getObject") &&
ClassUtils.hasMethod(factoryBeanType, method.getName(), method.getParameterTypes()));
ClassUtils.hasMethod(factoryBeanType, method));
}
/**