When an exception occurs during the execution of an event handler, it is
caught, wrapped inside an exception event and dispatched on the event
bus.
This applies to any throwable, but is not very useful for errors, as
these are not normally caught. Assertion errors in particular, which are
used in unit tests, should not be caught, as this would cause the test
runner to miss a failed test.
Therefore, errors are now transparently passed through to the caller of
the dispatch method.
When polymorphism or a priority is defined at listener-level and then
identically defined for a specific handler, a warning is issued.
This does not affect redefinitions of default values.
This is the first step for listener level handler properties.
To allow a handler inside a polymorphic listener to be non-polymorphic,
the @Polymorphic annotation now has a boolean value that defaults to
true. In that case, it can be explicitly set to false to override the
listener-level default.
An exception event wraps an event that caused an exception inside of an
event handler while being dispatched and is then dispatched to dedicated
handlers.
If an event handler has a non-void return type, a warning is issued as
the event bus cannot use the returned value.
In rare cases this might be justified as the event handler could be
invoked directly.
When encountering an event handler with an invalid signature, the
processor doesn't crash anymore. Also, event parameters that aren't
objects are now reported as errors.
The new @Priority annotation serves the exact same purpose as
@Event(priority = ...), 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.
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.
event-bus is now a parent project containing the two modules
event-bus-core (the previous event-bus) and event-bus-ap (annotation
processor).
The version of the parent project (and thus that of the modules) has
been bumped to 1.0.0, as this change breaks compatibility with previous
versions due to the different artifact, module and package names.