You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2018/04/19 12:39:25 UTC
[incubator-plc4x] branch master updated: remove falsely implemented
releases
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/master by this push:
new 9f6dcf6 remove falsely implemented releases
9f6dcf6 is described below
commit 9f6dcf6422de2f4fa9cea565971b6e171bce39ef
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Thu Apr 19 14:39:21 2018 +0200
remove falsely implemented releases
---
.../org/apache/plc4x/java/ads/protocol/Ads2PayloadProtocol.java | 6 ------
.../org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java | 3 ---
2 files changed, 9 deletions(-)
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Ads2PayloadProtocol.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Ads2PayloadProtocol.java
index 4b53edf..0cfc43d 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Ads2PayloadProtocol.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Ads2PayloadProtocol.java
@@ -77,7 +77,6 @@ public class Ads2PayloadProtocol extends MessageToMessageCodec<ByteBuf, AmsPacke
LOGGER.debug("Correlated packet received {}", correlatedAmsPacket);
}
if (dataLength.getAsLong() > Integer.MAX_VALUE) {
- byteBuf.release();
throw new IllegalStateException("Overflow in datalength: " + dataLength.getAsLong());
}
ByteBuf commandBuffer = byteBuf.readBytes((int) dataLength.getAsLong());
@@ -121,12 +120,8 @@ public class Ads2PayloadProtocol extends MessageToMessageCodec<ByteBuf, AmsPacke
out.add(amsPacket);
LOGGER.trace("Set amsPacket {} to out", amsPacket);
if (commandBuffer.readableBytes() > 0) {
- commandBuffer.release();
- byteBuf.release();
throw new IllegalStateException("Unread bytes left: " + commandBuffer.readableBytes());
}
- commandBuffer.release();
- byteBuf.release();
}
@@ -272,7 +267,6 @@ public class Ads2PayloadProtocol extends MessageToMessageCodec<ByteBuf, AmsPacke
AdsStampHeader adsStampHeader = handleStampHeader(adsDeviceNotificationBuffer);
adsStampHeaders.add(adsStampHeader);
}
- adsDeviceNotificationBuffer.release();
amsPacket = AdsDeviceNotificationRequest.of(amsHeader, length, stamps, adsStampHeaders);
} else {
amsPacket = UnknownCommand.of(amsHeader, commandBuffer);
diff --git a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
index 66ad189..4ef0fab 100644
--- a/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
+++ b/plc4j/protocols/ads/src/main/java/org/apache/plc4x/java/ads/protocol/Payload2SerialProtocol.java
@@ -43,7 +43,6 @@ public class Payload2SerialProtocol extends MessageToMessageCodec<ByteBuf, ByteB
out.add(AmsSerialFrame.of(FragmentNumber.of((byte) 0), UserData.of(amsPacket)).getByteBuf());
// TODO: we need to remember the fragment and maybe even need to spilt up the package
// TODO: if we exceed 255 byte
- amsPacket.release();
}
@Override
@@ -92,10 +91,8 @@ public class Payload2SerialProtocol extends MessageToMessageCodec<ByteBuf, ByteB
}
if (byteBuf.readableBytes() > 0) {
- byteBuf.release();
throw new IllegalStateException("Unread bytes left: " + byteBuf.readableBytes());
}
- byteBuf.release();
}
}
--
To stop receiving notification emails like this one, please contact
sruehl@apache.org.