aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-02 09:52:27 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-09-02 09:52:27 +1200
commit9bb5da56efe20fcf618751d5bb02bf19ba215c74 (patch)
tree936f22539fe9c399c91483597b4a93d2594ea5c5
parent5e0f914657067256827ebb6ec0c478e8b809d4d7 (diff)
downloadtrackermap-server-9bb5da56efe20fcf618751d5bb02bf19ba215c74.tar.gz
trackermap-server-9bb5da56efe20fcf618751d5bb02bf19ba215c74.tar.bz2
trackermap-server-9bb5da56efe20fcf618751d5bb02bf19ba215c74.zip
Fix code analysis issues
-rw-r--r--src/org/traccar/protocol/Gt06ProtocolDecoder.java4
-rw-r--r--src/org/traccar/protocol/SuntechProtocolDecoder.java6
2 files changed, 3 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
index ec3cec533..6c164386d 100644
--- a/src/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -155,9 +155,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return false;
}
- int length = buf.readUnsignedByte();
- position.set(Position.KEY_SATELLITES, BitUtil.to(length, 4));
- length = BitUtil.from(length, 4);
+ position.set(Position.KEY_SATELLITES, BitUtil.to(buf.readUnsignedByte(), 4));
double latitude = buf.readUnsignedInt() / 60.0 / 30000.0;
double longitude = buf.readUnsignedInt() / 60.0 / 30000.0;
diff --git a/src/org/traccar/protocol/SuntechProtocolDecoder.java b/src/org/traccar/protocol/SuntechProtocolDecoder.java
index ec764774d..68c920899 100644
--- a/src/org/traccar/protocol/SuntechProtocolDecoder.java
+++ b/src/org/traccar/protocol/SuntechProtocolDecoder.java
@@ -176,10 +176,8 @@ public class SuntechProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.KEY_BATTERY, Double.parseDouble(values[index++]));
}
- if (index < values.length) {
- if (values[index++].equals("0")) {
- position.set(Position.KEY_ARCHIVE, true);
- }
+ if (index < values.length && values[index++].equals("0")) {
+ position.set(Position.KEY_ARCHIVE, true);
}
if (includeAdc) {