From d0536ccbc1b7234784c5e48288bbac00a60ef821 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 7 Jul 2024 07:33:16 -0700 Subject: Update switch statements --- .../java/org/traccar/protocol/OsmAndProtocolDecoder.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/main/java/org/traccar/protocol/OsmAndProtocolDecoder.java') diff --git a/src/main/java/org/traccar/protocol/OsmAndProtocolDecoder.java b/src/main/java/org/traccar/protocol/OsmAndProtocolDecoder.java index c8968023a..b044b9596 100644 --- a/src/main/java/org/traccar/protocol/OsmAndProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/OsmAndProtocolDecoder.java @@ -151,15 +151,9 @@ public class OsmAndProtocolDecoder extends BaseHttpProtocolDecoder { position.set(entry.getKey(), Double.parseDouble(value)); } catch (NumberFormatException e) { switch (value) { - case "true": - position.set(entry.getKey(), true); - break; - case "false": - position.set(entry.getKey(), false); - break; - default: - position.set(entry.getKey(), value); - break; + case "true" -> position.set(entry.getKey(), true); + case "false" -> position.set(entry.getKey(), false); + default -> position.set(entry.getKey(), value); } } break; -- cgit v1.2.3