From 47398e91b1450c744cf3ed31de46f7ea02bbede1 Mon Sep 17 00:00:00 2001 From: Alexandre Truppel Date: Wed, 22 Feb 2023 16:05:21 +0100 Subject: Review --- src/main/java/org/traccar/protocol/WialonProtocolDecoder.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java b/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java index baf3847a1..1166d0708 100644 --- a/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/WialonProtocolDecoder.java @@ -145,7 +145,7 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { // This covers both integer (x:1:y) and double (x:2:y) types in the Wialon protocol // If not, value type is a string unless it is equal to some specific cases - // (true, yes, etc), in which case we convert into a boolean + // (true, false), in which case we convert into a boolean try { double doubleValue = Double.parseDouble(value); @@ -158,13 +158,9 @@ public class WialonProtocolDecoder extends BaseProtocolDecoder { position.set(key, doubleValue); } } catch (NumberFormatException e) { - if (value.equalsIgnoreCase("true") || value.equalsIgnoreCase("t") - || value.equalsIgnoreCase("yes") || value.equalsIgnoreCase("y") - || value.equalsIgnoreCase("on")) { + if (value.equalsIgnoreCase("true")) { position.set(key, true); - } else if (value.equalsIgnoreCase("false") || value.equalsIgnoreCase("f") - || value.equalsIgnoreCase("no") || value.equalsIgnoreCase("n") - || value.equalsIgnoreCase("off")) { + } else if (value.equalsIgnoreCase("false")) { position.set(key, false); } else { position.set(key, value); -- cgit v1.2.3