From 24c846056fc6bdca120ce96c32d75ff6c36f3ba0 Mon Sep 17 00:00:00 2001 From: nyash Date: Mon, 19 Sep 2016 12:20:49 +0200 Subject: use primitives and remove unused variables --- src/org/traccar/protocol/JpKorjarProtocolDecoder.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java index e5c80ee82..0cdc958c9 100644 --- a/src/org/traccar/protocol/JpKorjarProtocolDecoder.java +++ b/src/org/traccar/protocol/JpKorjarProtocolDecoder.java @@ -44,8 +44,6 @@ public class JpKorjarProtocolDecoder extends BaseProtocolDecoder { return null; } - Long imei = Long.parseLong(parts[1]); - int year = Integer.parseInt(parts[2].substring(0, 2)); int month = Integer.parseInt(parts[2].substring(2, 4)); int day = Integer.parseInt(parts[2].substring(4, 6)); @@ -53,19 +51,18 @@ public class JpKorjarProtocolDecoder extends BaseProtocolDecoder { int minute = Integer.parseInt(parts[2].substring(8, 10)); int second = Integer.parseInt(parts[2].substring(10, 12)); - Double latitude = Double.parseDouble(parts[3].substring(0, + double latitude = Double.parseDouble(parts[3].substring(0, Math.max(0, parts[3].length() - 1))); - Double longitude = Double.parseDouble(parts[4].substring(0, + double longitude = Double.parseDouble(parts[4].substring(0, Math.max(0, parts[4].length() - 1))); - Double speed = Double.parseDouble(parts[5]); - Double course = Double.parseDouble(parts[6]); + double speed = Double.parseDouble(parts[5]); + double course = Double.parseDouble(parts[6]); String[] batteryParts = parts[7].split(":"); - String batteryLevel = batteryParts[0]; - Double batteryVoltage = Double.parseDouble(batteryParts[1].substring(0, + double batteryVoltage = Double.parseDouble(batteryParts[1].substring(0, Math.max(0, batteryParts[1].length() - 1))); String[] codeParts = parts[8].split(" "); -- cgit v1.2.3