aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model/Position.java
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/model/Position.java
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/model/Position.java')
-rw-r--r--src/org/traccar/model/Position.java36
1 files changed, 6 insertions, 30 deletions
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 3943c1ef9..981c2292f 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -152,55 +152,31 @@ public class Position extends Message {
private Date serverTime;
public Date getServerTime() {
- if (serverTime != null) {
- return new Date(serverTime.getTime());
- } else {
- return null;
- }
+ return serverTime;
}
public void setServerTime(Date serverTime) {
- if (serverTime != null) {
- this.serverTime = new Date(serverTime.getTime());
- } else {
- this.serverTime = null;
- }
+ this.serverTime = serverTime;
}
private Date deviceTime;
public Date getDeviceTime() {
- if (deviceTime != null) {
- return new Date(deviceTime.getTime());
- } else {
- return null;
- }
+ return deviceTime;
}
public void setDeviceTime(Date deviceTime) {
- if (deviceTime != null) {
- this.deviceTime = new Date(deviceTime.getTime());
- } else {
- this.deviceTime = null;
- }
+ this.deviceTime = deviceTime;
}
private Date fixTime;
public Date getFixTime() {
- if (fixTime != null) {
- return new Date(fixTime.getTime());
- } else {
- return null;
- }
+ return fixTime;
}
public void setFixTime(Date fixTime) {
- if (fixTime != null) {
- this.fixTime = new Date(fixTime.getTime());
- } else {
- this.fixTime = null;
- }
+ this.fixTime = fixTime;
}
public void setTime(Date time) {