aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/reports
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-01-22 19:53:48 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-01-22 19:53:48 +1300
commit48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d (patch)
tree35a9c364f5659300b535834ccaaed737ed197a61 /src/org/traccar/reports
parent58ade656e2070387f95984f5851cbc41990467ba (diff)
downloadtrackermap-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.tar.gz
trackermap-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.tar.bz2
trackermap-server-48a5bd364b496de70a1a3eff8dd5c57c5d8fec9d.zip
Optimize date assignment
Diffstat (limited to 'src/org/traccar/reports')
-rw-r--r--src/org/traccar/reports/model/StopReport.java24
-rw-r--r--src/org/traccar/reports/model/TripReport.java24
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;