diff options
Diffstat (limited to 'src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java b/src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java index f71778412..0a6026d91 100644 --- a/src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/OutsafeProtocolDecoder.java @@ -77,10 +77,10 @@ public class OutsafeProtocolDecoder extends BaseHttpProtocolDecoder { } private void decodeUnknownParam(String name, JsonValue value, Position position) { - if (value instanceof JsonNumber) { - position.set(name, ((JsonNumber) value).doubleValue()); - } else if (value instanceof JsonString) { - position.set(name, ((JsonString) value).getString()); + if (value instanceof JsonNumber jsonNumber) { + position.set(name, jsonNumber.doubleValue()); + } else if (value instanceof JsonString jsonString) { + position.set(name, jsonString.getString()); } else if (value == JsonValue.TRUE || value == JsonValue.FALSE) { position.set(name, value == JsonValue.TRUE); } |