From 872b3953745a29cec3dbc6268e4c715b9d0f7517 Mon Sep 17 00:00:00 2001 From: kske Date: Mon, 1 Nov 2021 20:52:14 +0100 Subject: [PATCH] Rephrase some Javadoc As suggested by @delvh. --- .../src/main/java/dev/kske/eventbus/core/EventBus.java | 5 +++-- .../main/java/dev/kske/eventbus/core/EventBusException.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBus.java b/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBus.java index 3d8113d..44ff01c 100644 --- a/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBus.java +++ b/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBus.java @@ -75,14 +75,15 @@ public final class EventBus { private final Map, TreeSet> bindings = new ConcurrentHashMap<>(); /** - * Registered listeners. + * Stores all registered event listeners (which declare event handlers) and prevents them from + * being garbage collected. * * @since 0.0.1 */ private final Set registeredListeners = ConcurrentHashMap.newKeySet(); /** - * Thread-local dispatch state. + * The current event dispatching state, local to each thread. * * @since 0.1.0 */ diff --git a/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBusException.java b/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBusException.java index 959cbff..618a24a 100644 --- a/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBusException.java +++ b/event-bus-core/src/main/java/dev/kske/eventbus/core/EventBusException.java @@ -4,7 +4,7 @@ package dev.kske.eventbus.core; * This unchecked exception is specific to the event bus and can be thrown under the following * circumstances: *
    - *
  • An event handler throws an exception (which is stores as the cause)
  • + *
  • An event handler throws an exception (which is stored as the cause)
  • *
  • An event listener with an invalid event handler is registered
  • *
  • {@link EventBus#cancel()} is invoked from outside an active dispatch thread
  • *