aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
commiteb4ee7a9d4d0f132546b164c3483d62eb9e9f0db (patch)
tree29bc56f0f67cd49bac31a50e415c614ed4b1c5dc /src/org/traccar/MainEventHandler.java
parent320d41863864485c5675c9bf8332ff0845e5e812 (diff)
downloadtrackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.gz
trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.bz2
trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.zip
Clean up reported PMD issues
Diffstat (limited to 'src/org/traccar/MainEventHandler.java')
-rw-r--r--src/org/traccar/MainEventHandler.java28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java
index 933d0d975..8b94a68c9 100644
--- a/src/org/traccar/MainEventHandler.java
+++ b/src/org/traccar/MainEventHandler.java
@@ -30,24 +30,22 @@ public class MainEventHandler extends IdleStateAwareChannelHandler {
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
- if (e.getMessage() != null) {
- if (e.getMessage() instanceof Position) {
+ if (e.getMessage() != null && e.getMessage() instanceof Position) {
- Position position = (Position) e.getMessage();
+ Position position = (Position) e.getMessage();
- // Log position
- StringBuilder s = new StringBuilder();
- s.append(formatChannel(e.getChannel())).append(" ");
- s.append("id: ").append(position.getDeviceId()).append(", ");
- s.append("time: ").append(position.getFixTime()).append(", ");
- s.append("lat: ").append(position.getLatitude()).append(", ");
- s.append("lon: ").append(position.getLongitude()).append(", ");
- s.append("speed: ").append(position.getSpeed()).append(", ");
- s.append("course: ").append(position.getCourse());
- Log.info(s.toString());
+ // Log position
+ StringBuilder s = new StringBuilder();
+ s.append(formatChannel(e.getChannel())).append(" ");
+ s.append("id: ").append(position.getDeviceId()).append(", ");
+ s.append("time: ").append(position.getFixTime()).append(", ");
+ s.append("lat: ").append(position.getLatitude()).append(", ");
+ s.append("lon: ").append(position.getLongitude()).append(", ");
+ s.append("speed: ").append(position.getSpeed()).append(", ");
+ s.append("course: ").append(position.getCourse());
+ Log.info(s.toString());
- Context.getConnectionManager().update(position);
- }
+ Context.getConnectionManager().update(position);
}
}