Skip to content

Commit

Permalink
what was this ridiculous pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Aug 13, 2024
1 parent 22743d8 commit 3a40650
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<EngineState> ENGINE_STATE_CLASS = EngineState.class;
private final Object lock = new Object();

public void replaceStringValueAction(String key, Consumer<String> callback) {
Expand Down Expand Up @@ -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));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions java_console/ui/src/main/java/com/rusefi/ui/MessagesView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3a40650

Please sign in to comment.