From 70d22de4205aec294660378f0d854cbc32c7a6b8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 9 Jul 2016 13:07:02 +1200 Subject: Fix code analytics issues --- src/org/traccar/protocol/HuaShengProtocolDecoder.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/org/traccar/protocol/HuaShengProtocolDecoder.java') diff --git a/src/org/traccar/protocol/HuaShengProtocolDecoder.java b/src/org/traccar/protocol/HuaShengProtocolDecoder.java index 6743db47d..50517045b 100644 --- a/src/org/traccar/protocol/HuaShengProtocolDecoder.java +++ b/src/org/traccar/protocol/HuaShengProtocolDecoder.java @@ -19,7 +19,8 @@ import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; -import org.traccar.helper.*; +import org.traccar.helper.DateBuilder; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -96,12 +97,12 @@ public class HuaShengProtocolDecoder extends BaseProtocolDecoder { String time = buf.readBytes(12).toString(StandardCharsets.US_ASCII); DateBuilder dateBuilder = new DateBuilder() - .setYear(Integer.valueOf(time.substring(0, 2))) - .setMonth(Integer.valueOf(time.substring(2, 4))) - .setDay(Integer.valueOf(time.substring(4, 6))) - .setHour(Integer.valueOf(time.substring(6, 8))) - .setMinute(Integer.valueOf(time.substring(8, 10))) - .setSecond(Integer.valueOf(time.substring(10, 12))); + .setYear(Integer.parseInt(time.substring(0, 2))) + .setMonth(Integer.parseInt(time.substring(2, 4))) + .setDay(Integer.parseInt(time.substring(4, 6))) + .setHour(Integer.parseInt(time.substring(6, 8))) + .setMinute(Integer.parseInt(time.substring(8, 10))) + .setSecond(Integer.parseInt(time.substring(10, 12))); position.setTime(dateBuilder.getDate()); position.setLongitude(buf.readInt() * 0.00001); -- cgit v1.2.3