From 8b23656543c91826a9855e96f451d04b9c84504a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 24 Aug 2019 14:32:55 -0700 Subject: Fix PMD issues --- build.gradle | 2 +- pom.xml | 2 +- setup/traccar.iss | 2 +- src/main/java/org/traccar/protocol/BceProtocolDecoder.java | 4 ++-- src/main/java/org/traccar/protocol/GranitProtocol.java | 2 +- src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java | 2 +- src/main/java/org/traccar/protocol/SigfoxProtocolDecoder.java | 2 +- src/main/java/org/traccar/protocol/WondexProtocol.java | 2 +- swagger.json | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index f744cbf5f..0842a6a0f 100644 --- a/build.gradle +++ b/build.gradle @@ -80,7 +80,7 @@ jar { manifest { attributes( "Main-Class": "org.traccar.Main", - "Implementation-Version": "4.4", + "Implementation-Version": "4.6", "Class-Path": configurations.runtimeClasspath.files.collect { "lib/$it.name" }.join(" ")) } } diff --git a/pom.xml b/pom.xml index 0bece8eb6..3562ef149 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 org.traccar traccar - 4.5-SNAPSHOT + 4.6-SNAPSHOT traccar https://www.traccar.org diff --git a/setup/traccar.iss b/setup/traccar.iss index 3c0ddd0cf..9a4fc65b9 100644 --- a/setup/traccar.iss +++ b/setup/traccar.iss @@ -1,6 +1,6 @@ [Setup] AppName=Traccar -AppVersion=4.5 +AppVersion=4.6 DefaultDirName={pf}\Traccar OutputBaseFilename=traccar-setup ArchitecturesInstallIn64BitMode=x64 diff --git a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java index ad7271f2f..f07338937 100644 --- a/src/main/java/org/traccar/protocol/BceProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/BceProtocolDecoder.java @@ -97,7 +97,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { } } - private void decodeMask2(ByteBuf buf, int mask, Position position) { + private void decodeMask2(ByteBuf buf, int mask) { if (BitUtil.check(mask, 0)) { buf.readUnsignedShortLE(); // wheel speed @@ -223,7 +223,7 @@ public class BceProtocolDecoder extends BaseProtocolDecoder { if (masks.size() >= 2) { mask = masks.get(1); - decodeMask2(buf, mask, position); + decodeMask2(buf, mask); } if (masks.size() >= 3) { diff --git a/src/main/java/org/traccar/protocol/GranitProtocol.java b/src/main/java/org/traccar/protocol/GranitProtocol.java index cc5b125f1..244c3977b 100644 --- a/src/main/java/org/traccar/protocol/GranitProtocol.java +++ b/src/main/java/org/traccar/protocol/GranitProtocol.java @@ -28,7 +28,7 @@ public class GranitProtocol extends BaseProtocol { Command.TYPE_IDENTIFICATION, Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_SINGLE); - setTextCommandEncoder(new GranitProtocolSmsEncoder(GranitProtocol.this)); + setTextCommandEncoder(new GranitProtocolSmsEncoder(this)); setSupportedTextCommands( Command.TYPE_REBOOT_DEVICE, Command.TYPE_POSITION_PERIODIC); diff --git a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java index 06a379862..0c72568f3 100644 --- a/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/LaipacProtocolDecoder.java @@ -245,7 +245,7 @@ public class LaipacProtocolDecoder extends BaseProtocolDecoder { position.setNetwork(new Network(CellTower.from(mcc, mnc, lac, cid))); } - String unused = parser.next(); + parser.next(); // unused String checksum = parser.next(); diff --git a/src/main/java/org/traccar/protocol/SigfoxProtocolDecoder.java b/src/main/java/org/traccar/protocol/SigfoxProtocolDecoder.java index 0e0d8d608..7e0e3e110 100644 --- a/src/main/java/org/traccar/protocol/SigfoxProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/SigfoxProtocolDecoder.java @@ -70,7 +70,7 @@ public class SigfoxProtocolDecoder extends BaseHttpProtocolDecoder { ByteBuf buf = Unpooled.wrappedBuffer(DataConverter.parseHex(data)); try { int event = buf.readUnsignedByte(); - if ((event >> 4) == 0) { + if (event >> 4 == 0) { position.setValid(true); position.setLatitude(buf.readIntLE() * 0.0000001); diff --git a/src/main/java/org/traccar/protocol/WondexProtocol.java b/src/main/java/org/traccar/protocol/WondexProtocol.java index 82a18840e..035dd9160 100644 --- a/src/main/java/org/traccar/protocol/WondexProtocol.java +++ b/src/main/java/org/traccar/protocol/WondexProtocol.java @@ -25,7 +25,6 @@ import io.netty.handler.codec.string.StringEncoder; public class WondexProtocol extends BaseProtocol { public WondexProtocol() { - setTextCommandEncoder(new WondexProtocolEncoder(WondexProtocol.this)); setSupportedCommands( Command.TYPE_GET_DEVICE_STATUS, Command.TYPE_GET_MODEM_STATUS, @@ -33,6 +32,7 @@ public class WondexProtocol extends BaseProtocol { Command.TYPE_POSITION_SINGLE, Command.TYPE_GET_VERSION, Command.TYPE_IDENTIFICATION); + setTextCommandEncoder(new WondexProtocolEncoder(this)); addServer(new TrackerServer(false, getName()) { @Override protected void addProtocolHandlers(PipelineBuilder pipeline) { diff --git a/swagger.json b/swagger.json index 41e54df17..917892e65 100644 --- a/swagger.json +++ b/swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "version": "4.5", + "version": "4.6", "title": "traccar" }, "host": "demo.traccar.org", -- cgit v1.2.3