From 48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 22 Jan 2018 19:53:48 +1300 Subject: Optimize date assignment --- test/org/traccar/ProtocolTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'test/org/traccar/ProtocolTest.java') diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1daefabd6..5cbb651bf 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -27,11 +27,9 @@ public class ProtocolTest extends BaseTest { Position position = new Position(); - if (time != null) { - DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); - dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - position.setTime(dateFormat.parse(time)); - } + DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + position.setTime(dateFormat.parse(time)); position.setValid(valid); position.setLatitude(lat); position.setLongitude(lon); -- cgit v1.2.3