Only update handler accessibility if necessary
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
All checks were successful
zdm/event-bus/pipeline/head This commit looks good
This commit is contained in:
parent
36ed55fd71
commit
3aef7d5bcb
@ -57,8 +57,9 @@ public final class ReflectiveEventHandler implements EventHandler {
|
||||
? method.getAnnotation(Priority.class).value()
|
||||
: defPriority;
|
||||
|
||||
// Allow access if the method is non-public
|
||||
method.setAccessible(true);
|
||||
// Try to allow access if the method is not accessible
|
||||
if (!method.canAccess(Modifier.isStatic(method.getModifiers()) ? null : listener))
|
||||
method.setAccessible(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user