aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--findbugs.xml23
-rw-r--r--pom.xml3
-rw-r--r--src/org/traccar/protocol/MeitrackProtocolDecoder.java5
3 files changed, 29 insertions, 2 deletions
diff --git a/findbugs.xml b/findbugs.xml
new file mode 100644
index 000000000..18fba5c9a
--- /dev/null
+++ b/findbugs.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FindBugsFilter>
+ <Match>
+ <Class name="org.traccar.notification.PropertiesProvider" />
+ <Method name="getBoolean" />
+ <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
+ </Match>
+ <Match>
+ <Class name="org.traccar.protocol.TrvProtocolDecoder" />
+ <Method name="decodeOptionalValue" />
+ <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
+ </Match>
+ <Match>
+ <Class name="org.traccar.protocol.Gps056ProtocolDecoder" />
+ <Method name="decodeCoordinate" />
+ <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE" />
+ </Match>
+ <Match>
+ <Class name="org.traccar.protocol.PricolProtocolDecoder" />
+ <Method name="decode" />
+ <Bug pattern="ICAST_IDIV_CAST_TO_DOUBLE" />
+ </Match>
+</FindBugsFilter>
diff --git a/pom.xml b/pom.xml
index 46681661f..33b3a8092 100644
--- a/pom.xml
+++ b/pom.xml
@@ -314,6 +314,9 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.5</version>
+ <configuration>
+ <excludeFilterFile>findbugs.xml</excludeFilterFile>
+ </configuration>
</plugin>
<plugin>
<artifactId>maven-pmd-plugin</artifactId>
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
index 3de71fa14..b0195d09f 100644
--- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java
@@ -242,13 +242,14 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder {
}
if (parser.hasNext(2)) {
- decodeDataFields(position, parser.nextInt(), parser.next().split(","));
+ parser.nextInt(); // count
+ decodeDataFields(position, parser.next().split(","));
}
return position;
}
- private void decodeDataFields(Position position, int count, String[] values) {
+ private void decodeDataFields(Position position, String[] values) {
if (values.length > 1 && !values[1].isEmpty()) {
position.set("tempData", values[1]);