From 8550dc61aa70fea96cc73fc57969b8e0c4fab339 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Oct 2015 10:16:58 +1300 Subject: Replace object with system method --- src/org/traccar/protocol/CastelProtocolDecoder.java | 2 +- src/org/traccar/protocol/NavigilProtocolDecoder.java | 2 +- src/org/traccar/protocol/TaipProtocolDecoder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/CastelProtocolDecoder.java b/src/org/traccar/protocol/CastelProtocolDecoder.java index 358f6bb1d..95862cc9a 100644 --- a/src/org/traccar/protocol/CastelProtocolDecoder.java +++ b/src/org/traccar/protocol/CastelProtocolDecoder.java @@ -123,7 +123,7 @@ public class CastelProtocolDecoder extends BaseProtocolDecoder { response.writeShort(ChannelBuffers.swapShort(MSG_LOGIN_RESPONSE)); response.writeInt(0xFFFFFFFF); response.writeShort(0); - response.writeInt((int) (new Date().getTime() / 1000)); + response.writeInt((int) (System.currentTimeMillis() / 1000)); response.writeShort(Crc.crc16Ccitt(response.toByteBuffer(0, response.writerIndex()))); response.writeByte(0x0D); response.writeByte(0x0A); channel.write(response, remoteAddress); diff --git a/src/org/traccar/protocol/NavigilProtocolDecoder.java b/src/org/traccar/protocol/NavigilProtocolDecoder.java index 2b75e7840..7938fd7cc 100644 --- a/src/org/traccar/protocol/NavigilProtocolDecoder.java +++ b/src/org/traccar/protocol/NavigilProtocolDecoder.java @@ -70,7 +70,7 @@ public class NavigilProtocolDecoder extends BaseProtocolDecoder { header.writeShort(0); header.writeShort(Crc.crc16X25Ccitt(data.toByteBuffer())); header.writeInt(0); - header.writeInt((int) (new Date().getTime() / 1000) + LEAP_SECONDS_DELTA); + header.writeInt((int) (System.currentTimeMillis() / 1000) + LEAP_SECONDS_DELTA); if (channel != null) { channel.write(ChannelBuffers.copiedBuffer(header, data)); diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index 8c1448193..252f4e712 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -75,7 +75,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { long millis = time.getTimeInMillis() + seconds * 1000; - long diff = new Date().getTime() - millis; + long diff = System.currentTimeMillis() - millis; if (diff > 12 * 60 * 60 * 1000) { millis += 24 * 60 * 60 * 1000; -- cgit v1.2.3