From 0fd90a8ff40d41a425859763e1b563f6a0a378df Mon Sep 17 00:00:00 2001 From: Zontreck Date: Tue, 13 Feb 2024 01:26:17 -0700 Subject: [PATCH] Test another fix --- src/main/java/dev/zontreck/eventsbus/EventDispatcher.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java b/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java index b061ce7..560c8db 100644 --- a/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java +++ b/src/main/java/dev/zontreck/eventsbus/EventDispatcher.java @@ -102,10 +102,11 @@ public class EventDispatcher { try{ String packageName = pkg.getName(); - Field classesField = classLoader.getClass().getDeclaredField("classes"); - classesField.setAccessible(true); - List> classes = (List>) classesField.get(classLoader); + var clField = classLoader.getClass().getDeclaredField("classes"); + clField.setAccessible(true); + + List> classes = (List>) clField.get(classLoader); for(Class clazz : classes) {