Replace includeSubtypes with @Polymorphic
The new @Polymorphic annotation serves the exact same purpose as @Event(includeSubtypes = true), but should be easier to read in complex handler declarations. It has to be used in conjunction with the @Event annotation, not instead of it.
This commit is contained in:
@ -38,7 +38,8 @@ class DispatchTest implements EventListener {
|
||||
bus.dispatch(new SimpleEvent());
|
||||
}
|
||||
|
||||
@Event(eventType = SimpleEvent.class, includeSubtypes = true, priority = 200)
|
||||
@Event(eventType = SimpleEvent.class, priority = 200)
|
||||
@Polymorphic
|
||||
void onSimpleEventFirst() {
|
||||
++hits;
|
||||
assertTrue(hits == 1 || hits == 2);
|
||||
|
Reference in New Issue
Block a user