Skip to content

Commit 5e8f18e

Browse files
committed
Review comments
1 parent 6f56543 commit 5e8f18e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/hivemq-edge-module-opcua/src/main/java/com/hivemq/edge/adapters/opcua/OpcUaProtocolAdapter.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public void stop(final @NotNull ProtocolAdapterStopInput input, final @NotNull P
175175
OpcUaSubscriptionLifecycle temp = opcUaSubscriptionLifecycle;
176176
opcUaSubscriptionLifecycle = null;
177177
if (temp != null) {
178-
opcUaSubscriptionLifecycle.stop();
178+
temp.stop();
179179
}
180180
try {
181181
return opcUaClient
@@ -194,7 +194,8 @@ public void stop(final @NotNull ProtocolAdapterStopInput input, final @NotNull P
194194
public void discoverValues(
195195
final @NotNull ProtocolAdapterDiscoveryInput input,
196196
final @NotNull ProtocolAdapterDiscoveryOutput output) {
197-
Objects.requireNonNull(opcUaClient, "OPC UA Adapter not started yet");
197+
OpcUaClient client = opcUaClient;
198+
Objects.requireNonNull(client, "OPC UA Adapter not started yet");
198199

199200
final NodeId browseRoot;
200201
if (input.getRootNode() == null || input.getRootNode().isBlank()) {
@@ -207,7 +208,7 @@ public void discoverValues(
207208
browseRoot = parsedNodeId.get();
208209
}
209210

210-
browse(opcUaClient, browseRoot, null, (ref, parent) -> {
211+
browse(client, browseRoot, null, (ref, parent) -> {
211212
final String name = ref.getBrowseName() != null ? ref.getBrowseName().getName() : "";
212213
final String displayName = ref.getDisplayName() != null ? ref.getDisplayName().getText() : "";
213214
final NodeType nodeType = getNodeType(ref);

0 commit comments

Comments
 (0)