From a3412e9cca5baf09859d7e5bbfe660d68716f7c7 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 20 Oct 2018 10:35:27 +0400 Subject: Fix some Java issues --- src/org/traccar/WindowsService.java | 2 +- src/org/traccar/protocol/AnytrekProtocolDecoder.java | 2 +- src/org/traccar/protocol/CellocatorFrameDecoder.java | 4 ---- src/org/traccar/protocol/EelinkProtocolEncoder.java | 4 ---- 4 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/org/traccar/WindowsService.java b/src/org/traccar/WindowsService.java index 263d75a0e..158aa5540 100644 --- a/src/org/traccar/WindowsService.java +++ b/src/org/traccar/WindowsService.java @@ -140,7 +140,7 @@ public abstract class WindowsService { Advapi32.INSTANCE.CloseServiceHandle(serviceManager); } - return (success); + return success; } public void init() throws URISyntaxException { diff --git a/src/org/traccar/protocol/AnytrekProtocolDecoder.java b/src/org/traccar/protocol/AnytrekProtocolDecoder.java index 7665e6cfd..c48f59c90 100644 --- a/src/org/traccar/protocol/AnytrekProtocolDecoder.java +++ b/src/org/traccar/protocol/AnytrekProtocolDecoder.java @@ -48,7 +48,7 @@ public class AnytrekProtocolDecoder extends BaseProtocolDecoder { response.writeShortLE(0); // checksum response.writeByte('\r'); response.writeByte('\n'); - channel.writeAndFlush(new NetworkMessage(response, channel.remoteAddress())); + channel.writeAndFlush(new NetworkMessage(response, remoteAddress)); } } diff --git a/src/org/traccar/protocol/CellocatorFrameDecoder.java b/src/org/traccar/protocol/CellocatorFrameDecoder.java index 9bf9601fe..7d5499d92 100644 --- a/src/org/traccar/protocol/CellocatorFrameDecoder.java +++ b/src/org/traccar/protocol/CellocatorFrameDecoder.java @@ -18,14 +18,10 @@ package org.traccar.protocol; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.traccar.BaseFrameDecoder; public class CellocatorFrameDecoder extends BaseFrameDecoder { - private static final Logger LOGGER = LoggerFactory.getLogger(CellocatorFrameDecoder.class); - private static final int MESSAGE_MINIMUM_LENGTH = 15; @Override diff --git a/src/org/traccar/protocol/EelinkProtocolEncoder.java b/src/org/traccar/protocol/EelinkProtocolEncoder.java index c3ff88e1e..c005fbc67 100644 --- a/src/org/traccar/protocol/EelinkProtocolEncoder.java +++ b/src/org/traccar/protocol/EelinkProtocolEncoder.java @@ -17,8 +17,6 @@ package org.traccar.protocol; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.traccar.BaseProtocolEncoder; import org.traccar.helper.DataConverter; import org.traccar.model.Command; @@ -28,8 +26,6 @@ import java.nio.charset.StandardCharsets; public class EelinkProtocolEncoder extends BaseProtocolEncoder { - private static final Logger LOGGER = LoggerFactory.getLogger(EelinkProtocolEncoder.class); - private boolean connectionless; public EelinkProtocolEncoder(boolean connectionless) { -- cgit v1.2.3