From 3a4065045def93863db76720b207b47ed8855ba8 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 13 Aug 2024 12:00:29 -0700 Subject: [PATCH] what was this ridiculous pattern --- java_console/io/src/main/java/com/rusefi/io/CommandQueue.java | 2 +- .../models/src/main/java/com/rusefi/core/EngineState.java | 3 +-- java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/java_console/io/src/main/java/com/rusefi/io/CommandQueue.java b/java_console/io/src/main/java/com/rusefi/io/CommandQueue.java index a5d1750ff8..d6eeb972ff 100644 --- a/java_console/io/src/main/java/com/rusefi/io/CommandQueue.java +++ b/java_console/io/src/main/java/com/rusefi/io/CommandQueue.java @@ -107,7 +107,7 @@ public CommandQueue(LinkManager linkManager) { @SuppressWarnings("InfiniteLoopStatement") @Override public void run() { - linkManager.messageListener.postMessage(COMMAND_QUEUE_CLASS, "SerialIO started"); + linkManager.messageListener.postMessage(CommandQueue.class, "SerialIO started"); while (true) { try { sendPendingCommand(); diff --git a/java_console/models/src/main/java/com/rusefi/core/EngineState.java b/java_console/models/src/main/java/com/rusefi/core/EngineState.java index 8217ead8ec..2632bfa86f 100644 --- a/java_console/models/src/main/java/com/rusefi/core/EngineState.java +++ b/java_console/models/src/main/java/com/rusefi/core/EngineState.java @@ -21,7 +21,6 @@ public class EngineState { private static final Logging log = getLogging(EngineState.class); public static final String PACKING_DELIMITER = ":"; - public static final Class ENGINE_STATE_CLASS = EngineState.class; private final Object lock = new Object(); public void replaceStringValueAction(String key, Consumer callback) { @@ -65,7 +64,7 @@ public EngineState(@NotNull final EngineStateListener listener) { } }); - registerStringValueAction(Fields.PROTOCOL_MSG, value -> MessagesCentral.getInstance().postMessage(ENGINE_STATE_CLASS, value)); + registerStringValueAction(Fields.PROTOCOL_MSG, value -> MessagesCentral.getInstance().postMessage(EngineState.class, value)); } /** diff --git a/java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java b/java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java index 2255c07c6e..dd7e8022fd 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java @@ -101,9 +101,9 @@ private void append(String line, Class clazz) { * this is ugly as hell, but that's so much better then nothing... */ private AttributeSet getStyle(Class clazz) { - if (clazz == CommandQueue.COMMAND_QUEUE_CLASS) + if (clazz == CommandQueue.class) return bold; - if (clazz == EngineState.ENGINE_STATE_CLASS) + if (clazz == EngineState.class) return italic; return null; }