The isAccessible() check is unnecessary.
This commit is contained in:
@@ -69,9 +69,7 @@ public class Runnables
|
|||||||
{
|
{
|
||||||
for (Method method : clazz.getDeclaredMethods()) {
|
for (Method method : clazz.getDeclaredMethods()) {
|
||||||
if (method.getName().equals(methodName) && method.getParameterTypes().length == 0) {
|
if (method.getName().equals(methodName) && method.getParameterTypes().length == 0) {
|
||||||
if (!method.isAccessible()) {
|
method.setAccessible(true); // isAccessible() check is too slow
|
||||||
method.setAccessible(true);
|
|
||||||
}
|
|
||||||
return method;
|
return method;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user