hutcheb commented on a change in pull request #227:
URL: https://github.com/apache/plc4x/pull/227#discussion_r588202176



##########
File path: 
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/connection/OpcuaTcpPlcConnection.java
##########
@@ -384,8 +385,8 @@ public void close() throws Exception {
         CompletableFuture<PlcSubscriptionResponse> future = 
CompletableFuture.supplyAsync(() -> {
             Map<String, ResponseItem<PlcSubscriptionHandle>> responseItems = 
new HashMap<>();
             for (String fieldName : subscriptionRequest.getFieldNames()) {
-                final PlcSubscriptionField subscriptionField = 
subscriptionRequest.getField(fieldName);
-                final OpcuaField field = (OpcuaField) 
Objects.requireNonNull(subscriptionField);
+                final DefaultPlcSubscriptionField subscriptionField = 
(DefaultPlcSubscriptionField) subscriptionRequest.getField(fieldName);

Review comment:
       We are using the DefaultPlcSubscriptionRequest class which creates a 
DefaultPlcSubscriptionField containing the OpcuaField. This needs to be cast to 
DefaultPcSubscriptionField so we can get the PlcField from it. It would be good 
if the DefaultPlcSubscriptionRequest created a PlcSubscriptionField based off 
that returned by the PlcDriver though.
   
   At the moment the OpcuaField doesn't need to implement the 
PlcSubscriptionField.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to