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

hutcheb pushed a commit to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/feature/mspec-ng by this push:
     new 53e2bff  Fixed OPCUA subscription acknowledgment response.
53e2bff is described below

commit 53e2bff6e2242218379a1e6266e1451b89dadff2
Author: hutcheb <[email protected]>
AuthorDate: Mon Nov 1 20:32:04 2021 +1000

    Fixed OPCUA subscription acknowledgment response.
---
 .../org/apache/plc4x/java/opcua/protocol/OpcuaSubscriptionHandle.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaSubscriptionHandle.java
 
b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaSubscriptionHandle.java
index e0333bc..04cddbc 100644
--- 
a/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaSubscriptionHandle.java
+++ 
b/plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/protocol/OpcuaSubscriptionHandle.java
@@ -229,7 +229,7 @@ public class OpcuaSubscriptionHandle extends 
DefaultPlcSubscriptionHandle {
         LOGGER.trace("Starting Subscription");
         CompletableFuture.supplyAsync(() -> {
             try {
-                List<ExtensionObjectDefinition> outstandingAcknowledgements = 
new LinkedList<>();
+                LinkedList<ExtensionObjectDefinition> 
outstandingAcknowledgements = new LinkedList<>();
                 List<Long> outstandingRequests = new LinkedList<>();
                 while (!this.destroy.get()) {
                     long requestHandle = channel.getRequestHandle();
@@ -245,7 +245,7 @@ public class OpcuaSubscriptionHandle extends 
DefaultPlcSubscriptionHandle {
                             OpcuaProtocolLogic.NULL_EXTENSION_OBJECT);
 
                         //Make a copy of the outstanding requests, so it isn't 
modified while we are putting the ack list together.
-                        List<ExtensionObjectDefinition> acks = 
Collections.unmodifiableList(outstandingAcknowledgements);
+                        List<ExtensionObjectDefinition> acks = 
(LinkedList<ExtensionObjectDefinition>) outstandingAcknowledgements.clone();
                         int ackLength = acks.size() == 0 ? -1 : acks.size();
                         outstandingAcknowledgements.removeAll(acks);
 

Reply via email to