Bypass method access checks for event handlers
This commit is contained in:
parent
70bcfd5125
commit
f407021cea
@ -27,6 +27,7 @@ final class EventHandler implements Comparable<EventHandler> {
|
|||||||
this.listener = listener;
|
this.listener = listener;
|
||||||
this.method = method;
|
this.method = method;
|
||||||
this.annotation = annotation;
|
this.annotation = annotation;
|
||||||
|
method.setAccessible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,13 +26,13 @@ class EventBusTest implements EventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Event(priority = 50)
|
@Event(priority = 50)
|
||||||
public void onSimpleEventSecond(SimpleEvent event) {
|
private void onSimpleEventSecond(SimpleEvent event) {
|
||||||
++hits;
|
++hits;
|
||||||
assertEquals(2, hits);
|
assertEquals(2, hits);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Event(priority = 150)
|
@Event(priority = 150)
|
||||||
public void onSimpleEventFirst(SimpleEvent event) {
|
private void onSimpleEventFirst(SimpleEvent event) {
|
||||||
++hits;
|
++hits;
|
||||||
assertEquals(1, hits);
|
assertEquals(1, hits);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user