diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/ParseState.java b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/ParseState.java index 66bb7c0549..b3e2d0916a 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/ParseState.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/ParseState.java @@ -55,16 +55,13 @@ public class ParseState implements DefinitionsState { switch (existingDefinition.overwritePolicy) { case NotAllowed: throw new IllegalStateException("Tried to add definition for " + name + ", but one already existed."); - case Replace: - definitions.remove(name); - break; case IgnoreNew: // ignore the new definition, do nothing return; } } - definitions.put(name, new Definition(name, value, overwritePolicy)); + definitions.put(name, new Definition(value, overwritePolicy)); } private void addDefinition(String name, Object value) { diff --git a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/parsing/Definition.java b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/parsing/Definition.java index 089d9c387b..f923abb9e3 100644 --- a/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/parsing/Definition.java +++ b/java_tools/configuration_definition/src/main/java/com/rusefi/newparse/parsing/Definition.java @@ -1,34 +1,19 @@ package com.rusefi.newparse.parsing; public class Definition { - public final String name; public final Object value; public final OverwritePolicy overwritePolicy; public enum OverwritePolicy { NotAllowed, - Replace, IgnoreNew } - public Definition(String name, Object value, OverwritePolicy overwritePolicy) { - this.name = name; + public Definition(Object value, OverwritePolicy overwritePolicy) { this.value = value; this.overwritePolicy = overwritePolicy; } - public boolean isNumeric() { - return this.value instanceof Double || this.value instanceof Integer; - } - - public double asDouble() { - if (this.value instanceof Double) { - return ((Double)this.value); - } else { - return ((Integer)this.value).doubleValue(); - } - } - @Override public String toString() { return this.value.toString();