Bump odlparent to 6.0.0
[netconf.git] / restconf / restconf-nb-bierman02 / src / main / java / org / opendaylight / netconf / sal / restconf / impl / BatchedExistenceCheck.java
index c15363dcb601e933513d8dc51299a53ac7174992..843e9edb8c15ab859a41cd423d0199e40566bfbb 100644 (file)
@@ -8,8 +8,6 @@
 package org.opendaylight.netconf.sal.restconf.impl;
 
 import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.SettableFuture;
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -18,10 +16,9 @@ import java.util.Collection;
 import java.util.Map.Entry;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import javax.annotation.Nonnull;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.common.api.ReadFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadOperations;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
@@ -38,16 +35,15 @@ final class BatchedExistenceCheck {
         this.outstanding = total;
     }
 
-    static BatchedExistenceCheck start(final DOMDataTreeReadTransaction readTx,
+    static BatchedExistenceCheck start(final DOMDataTreeReadOperations readTx,
             final LogicalDatastoreType datastore, final YangInstanceIdentifier parentPath,
             final Collection<? extends NormalizedNode<?, ?>> children) {
         final BatchedExistenceCheck ret = new BatchedExistenceCheck(children.size());
         for (NormalizedNode<?, ?> child : children) {
             final YangInstanceIdentifier path = parentPath.node(child.getIdentifier());
-            final ListenableFuture<Boolean> f = readTx.exists(datastore, path);
-            Futures.addCallback(f, new FutureCallback<Boolean>() {
+            readTx.exists(datastore, path).addCallback(new FutureCallback<Boolean>() {
                 @Override
-                public void onSuccess(@Nonnull final Boolean result) {
+                public void onSuccess(final Boolean result) {
                     ret.complete(path, result);
                 }
 
@@ -78,6 +74,8 @@ final class BatchedExistenceCheck {
         }
     }
 
+    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+            justification = "https://github.com/spotbugs/spotbugs/issues/811")
     private void complete(final YangInstanceIdentifier childPath, final boolean present) {
         final int count = UPDATER.decrementAndGet(this);
         if (present) {
@@ -87,6 +85,8 @@ final class BatchedExistenceCheck {
         }
     }
 
+    @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+            justification = "https://github.com/spotbugs/spotbugs/issues/811")
     private void complete(final YangInstanceIdentifier childPath, final ReadFailedException cause) {
         UPDATER.decrementAndGet(this);
         future.set(new SimpleImmutableEntry<>(childPath, cause));