aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/MegastekProtocolDecoder.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/protocol/MegastekProtocolDecoder.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/protocol/MegastekProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/MegastekProtocolDecoder.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/MegastekProtocolDecoder.java b/src/org/traccar/protocol/MegastekProtocolDecoder.java
index 37bf5a0d4..17e9dc6d7 100644
--- a/src/org/traccar/protocol/MegastekProtocolDecoder.java
+++ b/src/org/traccar/protocol/MegastekProtocolDecoder.java
@@ -128,7 +128,7 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
private Position decodeOld(Channel channel, String sentence) {
// Detect type
- boolean simple = (sentence.charAt(3) == ',' || sentence.charAt(6) == ',');
+ boolean simple = sentence.charAt(3) == ',' || sentence.charAt(6) == ',';
// Split message
String id;
@@ -189,10 +189,8 @@ public class MegastekProtocolDecoder extends BaseProtocolDecoder {
position.set(Event.KEY_ALARM, parser.group(index++));
// IMEI
- if (!identify(parser.group(index++), channel, null, false)) {
- if (!identify(id, channel)) {
- return null;
- }
+ if (!identify(parser.group(index++), channel, null, false) && !identify(id, channel)) {
+ return null;
}
position.setDeviceId(getDeviceId());