Fix subclass inclusion in EventBus

This commit is contained in:
Kai S. K. Engelbart 2020-07-04 15:20:47 +02:00
parent 470558086e
commit 1c53694d5e
No known key found for this signature in database
GPG Key ID: 0A48559CA32CB48F

View File

@ -66,7 +66,12 @@ public class EventBus {
* @since Envoy v0.2-alpha
*/
public void dispatch(Event<?> event) {
handlers.keySet().stream().filter(event.getClass()::isAssignableFrom).map(handlers::get).flatMap(List::stream).forEach(h -> h.accept(event));
handlers.keySet()
.stream()
.filter(event.getClass()::equals)
.map(handlers::get)
.flatMap(List::stream)
.forEach(h -> h.accept(event));
}
/**