aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/HuaShengProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-09 13:07:02 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-09 13:07:02 +1200
commit70d22de4205aec294660378f0d854cbc32c7a6b8 (patch)
treeb425bcf00113b3d8bb65ba160a7723f66e12a977 /src/org/traccar/protocol/HuaShengProtocolDecoder.java
parent32c836e90bd75e68cac1d704b048a3c4ff22775f (diff)
downloadtrackermap-server-70d22de4205aec294660378f0d854cbc32c7a6b8.tar.gz
trackermap-server-70d22de4205aec294660378f0d854cbc32c7a6b8.tar.bz2
trackermap-server-70d22de4205aec294660378f0d854cbc32c7a6b8.zip
Fix code analytics issues
Diffstat (limited to 'src/org/traccar/protocol/HuaShengProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/HuaShengProtocolDecoder.java15
1 files changed, 8 insertions, 7 deletions
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);