Skip to content

Commit

Permalink
Fix and disable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Jan 9, 2018
1 parent ebb5e7e commit 232de5f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
23 changes: 23 additions & 0 deletions findbugs.xml
Original file line number Diff line number Diff line change
@@ -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>
3 changes: 3 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 3 additions & 2 deletions src/org/traccar/protocol/MeitrackProtocolDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,14 @@ private Position decodeRegular(Channel channel, SocketAddress remoteAddress, Cha
}

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]);
Expand Down

0 comments on commit 232de5f

Please sign in to comment.