From f3acca74568b82cbfef39624b2a83fa6233bd1bb Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 21 Jul 2024 21:22:53 +0200 Subject: [PATCH] Move logCall() invocation outside of Runnable This ensures debug log messages are kept in order --- .../sosengine/base/classes/helpers/EventHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java index 709f0a89..520e29bd 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/helpers/EventHelper.java @@ -143,11 +143,11 @@ public class EventHelper { * @since v1-alpha0 */ public static void invokeAnnotatedMethods(@NotNull Class event, Object... arguments) { - Runnable eventCode = () -> { - LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE)); - if (event != LogEvent.class) - logCall(event); + LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE)); + if (event != LogEvent.class) + logCall(event); + Runnable eventCode = () -> { for (ReflectionMethod method : getAnnotatedMethods(event)) { try { method.invoke(arguments);