You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2018/10/24 20:30:01 UTC

[incubator-plc4x] 05/07: - Resolving some simple Sonar findings

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git

commit 7d5d2f8d80d94dfb6315d829d15dcfe1a0bb51f3
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Oct 24 21:28:16 2018 +0100

    - Resolving some simple Sonar findings
---
 .../org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plc4j/protocols/ethernetip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java b/plc4j/protocols/ethernetip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
index 49087c1..a4d823f 100644
--- a/plc4j/protocols/ethernetip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
+++ b/plc4j/protocols/ethernetip/src/main/java/org/apache/plc4x/java/ethernetip/netty/Plc4XEtherNetIpProtocol.java
@@ -121,7 +121,7 @@ public class Plc4XEtherNetIpProtocol extends MessageToMessageCodec<EnipPacket, P
     protected void encode(ChannelHandlerContext ctx, PlcRequestContainer<InternalPlcRequest, InternalPlcResponse> msg, List<Object> out) {
         LOGGER.trace("(<--OUT): {}, {}, {}", ctx, msg, out);
         // Reset transactionId on overflow
-        messageId.compareAndSet(Short.MAX_VALUE + 1, 0);
+        messageId.compareAndSet(Short.MAX_VALUE + 1L, 0);
         PlcRequest request = msg.getRequest();
         if (request instanceof PlcReadRequest) {
             encodeReadRequest(msg, out);