diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-22 19:53:48 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-01-22 19:53:48 +1300 |
commit | 48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d (patch) | |
tree | 35a9c364f5659300b535834ccaaed737ed197a61 /src/org/traccar/reports/model | |
parent | 58ade656e2070387f95984f5851cbc41990467ba (diff) | |
download | traccar-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.tar.gz traccar-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.tar.bz2 traccar-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.zip |
Optimize date assignment
Diffstat (limited to 'src/org/traccar/reports/model')
-rw-r--r-- | src/org/traccar/reports/model/StopReport.java | 24 | ||||
-rw-r--r-- | src/org/traccar/reports/model/TripReport.java | 24 |
2 files changed, 8 insertions, 40 deletions
diff --git a/src/org/traccar/reports/model/StopReport.java b/src/org/traccar/reports/model/StopReport.java index 6b2e86299..245292b63 100644 --- a/src/org/traccar/reports/model/StopReport.java +++ b/src/org/traccar/reports/model/StopReport.java @@ -53,37 +53,21 @@ public class StopReport extends BaseReport { private Date startTime; public Date getStartTime() { - if (startTime != null) { - return new Date(startTime.getTime()); - } else { - return null; - } + return startTime; } public void setStartTime(Date startTime) { - if (startTime != null) { - this.startTime = new Date(startTime.getTime()); - } else { - this.startTime = null; - } + this.startTime = startTime; } private Date endTime; public Date getEndTime() { - if (endTime != null) { - return new Date(endTime.getTime()); - } else { - return null; - } + return endTime; } public void setEndTime(Date endTime) { - if (endTime != null) { - this.endTime = new Date(endTime.getTime()); - } else { - this.endTime = null; - } + this.endTime = endTime; } private String address; diff --git a/src/org/traccar/reports/model/TripReport.java b/src/org/traccar/reports/model/TripReport.java index 42a4240b7..3140f3019 100644 --- a/src/org/traccar/reports/model/TripReport.java +++ b/src/org/traccar/reports/model/TripReport.java @@ -83,19 +83,11 @@ public class TripReport extends BaseReport { private Date startTime; public Date getStartTime() { - if (startTime != null) { - return new Date(startTime.getTime()); - } else { - return null; - } + return startTime; } public void setStartTime(Date startTime) { - if (startTime != null) { - this.startTime = new Date(startTime.getTime()); - } else { - this.startTime = null; - } + this.startTime = startTime; } private String startAddress; @@ -111,19 +103,11 @@ public class TripReport extends BaseReport { private Date endTime; public Date getEndTime() { - if (endTime != null) { - return new Date(endTime.getTime()); - } else { - return null; - } + return endTime; } public void setEndTime(Date endTime) { - if (endTime != null) { - this.endTime = new Date(endTime.getTime()); - } else { - this.endTime = null; - } + this.endTime = endTime; } private String endAddress; |