From 083c519f1e1086c99c1d23ed5259b45a9663514a Mon Sep 17 00:00:00 2001 From: rusEFI LLC Date: Fri, 26 Apr 2024 16:46:21 -0400 Subject: [PATCH] only: reducing magic constants --- .../src/main/java/com/rusefi/ConfigDefinition.java | 3 ++- .../src/main/java/com/rusefi/tools/tune/MetaHelper.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java index 56de2cb7c5..8d075b55c4 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/ConfigDefinition.java @@ -34,6 +34,7 @@ public class ConfigDefinition { private static final String KEY_ZERO_INIT = "-initialize_to_zero"; private static final String KEY_BOARD_NAME = "-board"; public static final String CONFIG_PATH = "java_tools/configuration_definition/src/main/resources/config_definition.options"; + public static final String READFILE_OPTION = "-readfile"; public static void main(String[] args) { try { @@ -106,7 +107,7 @@ public class ConfigDefinition { state.addDestination(new GetConfigValueConsumer(cppFile, mdFile, LazyFile.REAL)); } break; - case "-readfile": + case READFILE_OPTION: String keyName = args[i + 1]; // yes, we take three parameters here thus pre-increment! String fileName = args[++i + 1]; diff --git a/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/MetaHelper.java b/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/MetaHelper.java index 56578804a9..87e52113b8 100644 --- a/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/MetaHelper.java +++ b/java_tools/tune-tools/src/main/java/com/rusefi/tools/tune/MetaHelper.java @@ -22,7 +22,7 @@ public class MetaHelper { static ReaderStateImpl getReaderState() throws IOException { List options = Files.readAllLines(Paths.get(RootHolder.ROOT + "../" + ConfigDefinition.CONFIG_PATH)); // add default (empty) board config - options.add("-readfile"); + options.add(ConfigDefinition.READFILE_OPTION); options.add("BOARD_CONFIG_FROM_FILE"); options.add("tunerstudio/empty_board_options.ini");