From a71833f0f0d25b669f6a076cc98472a56532c99f Mon Sep 17 00:00:00 2001
From: Leumor <116955025+leumor@users.noreply.github.com>
Date: Sun, 1 Feb 2026 21:31:24 +0000
Subject: [PATCH] refactor(core): simplify event dispatch helpers
Drop the no-op dispatch priority setter and tighten dispatcher docs. Remove the redundant record constructor and clarify test redirects.
---
.../util/ReflectiveEventDispatch.java | 33 +++++++------------
.../events/SplitfileProgressTimestamps.java | 14 +-------
.../http/FirstTimeWizardNewToadletTest.java | 4 ++-
3 files changed, 16 insertions(+), 35 deletions(-)
diff --git a/src/main/java/com/onionnetworks/util/ReflectiveEventDispatch.java b/src/main/java/com/onionnetworks/util/ReflectiveEventDispatch.java
index ae50eb0f440..ca3afc92996 100644
--- a/src/main/java/com/onionnetworks/util/ReflectiveEventDispatch.java
+++ b/src/main/java/com/onionnetworks/util/ReflectiveEventDispatch.java
@@ -19,10 +19,11 @@
*
The dispatcher maintains a daemon thread that repeatedly removes queued {@code EventObject}
* instances, looks up listeners that registered interest in the originating event source and the
* supplied method name, and invokes that method with the event as its sole argument. Listener look-
- * * ups and queue mutations are synchronized on the dispatcher instance, allowing multiple producer
+ * * ups and queue mutations are synchronized in the dispatcher instance, allowing multiple producer
* threads to submit events while the consumer thread drains the queue. Method lookups are cached to
- * avoid repeated reflective discovery, but execution order remains FIFO for submitted events. When
- * no listeners are registered for a given method name and source, the event is silently skipped.
+ * avoid repeated reflective discovery, but the execution order remains FIFO for submitted events.
+ * When no listeners are registered for a given method name and source, the event is silently
+ * skipped.
*
*
Use this class when you need a lightweight, per-source event bus without committing to a
* broader framework. Typical usage registers listeners tied to a particular publisher object and
@@ -46,11 +47,11 @@ public class ReflectiveEventDispatch implements Runnable {
private static final Logger LOGGER = Logger.getLogger(ReflectiveEventDispatch.class.getName());
- private final Thread thread;
private final Map methodCache = new HashMap<>();
private final Map