Remove FindBugs workaround
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / databroker / actors / dds / LocalProxyTransaction.java
index aef5f8bbc644b5ac0742484f1b3160a710f1eafd..662ccba85d826c13ec280011a1629f921cc5c74c 100644 (file)
@@ -104,22 +104,18 @@ abstract class LocalProxyTransaction extends AbstractProxyTransaction {
         // Note we delay completion of read requests to limit the scope at which the client can run, as they have
         // listeners, which we do not want to execute while we are reconnecting.
         if (request instanceof ReadTransactionRequest) {
-            final YangInstanceIdentifier path = ((ReadTransactionRequest) request).getPath();
-            final Optional<NormalizedNode> result = readOnlyView().readNode(path);
             if (callback != null) {
-                // XXX: FB does not see that callback is final, on stack and has be check for non-null.
-                final Consumer<Response<?, ?>> fbIsStupid = requireNonNull(callback);
-                executeInActor(() -> fbIsStupid.accept(new ReadTransactionSuccess(request.getTarget(),
+                final YangInstanceIdentifier path = ((ReadTransactionRequest) request).getPath();
+                final Optional<NormalizedNode> result = readOnlyView().readNode(path);
+                executeInActor(() -> callback.accept(new ReadTransactionSuccess(request.getTarget(),
                     request.getSequence(), result)));
             }
             return true;
         } else if (request instanceof ExistsTransactionRequest) {
-            final YangInstanceIdentifier path = ((ExistsTransactionRequest) request).getPath();
-            final boolean result = readOnlyView().readNode(path).isPresent();
             if (callback != null) {
-                // XXX: FB does not see that callback is final, on stack and has be check for non-null.
-                final Consumer<Response<?, ?>> fbIsStupid = requireNonNull(callback);
-                executeInActor(() -> fbIsStupid.accept(new ExistsTransactionSuccess(request.getTarget(),
+                final YangInstanceIdentifier path = ((ExistsTransactionRequest) request).getPath();
+                final boolean result = readOnlyView().readNode(path).isPresent();
+                executeInActor(() -> callback.accept(new ExistsTransactionSuccess(request.getTarget(),
                     request.getSequence(), result)));
             }
             return true;