Fix deprecation warning in PingPongTransactionChain 64/62264/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Aug 2017 11:10:58 +0000 (13:10 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Aug 2017 11:10:58 +0000 (13:10 +0200)
Add MoreExecutors.directExecutor(). Also fix up formatting.

Change-Id: I4dcc849c643713b738f2d99b1250848e46fbe82a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongTransactionChain.java

index df0dbcd..7a9f5e3 100644 (file)
@@ -14,6 +14,7 @@ import com.google.common.util.concurrent.CheckedFuture;
 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 java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.Map.Entry;
 import java.util.concurrent.CancellationException;
@@ -242,7 +243,7 @@ public final class PingPongTransactionChain implements DOMTransactionChain {
             public void onFailure(final Throwable t) {
                 transactionFailed(tx, t);
             }
-        });
+        }, MoreExecutors.directExecutor());
     }
 
     /*
@@ -329,7 +330,6 @@ public final class PingPongTransactionChain implements DOMTransactionChain {
      * @param tx Backend shared transaction
      * @param frontendTx
      * @param isOpen indicator whether the transaction was already closed
-     * @return True if cancellation succeeded, false otherwise
      */
     synchronized void cancelTransaction(final PingPongTransaction tx, final DOMDataReadWriteTransaction frontendTx) {
         // Attempt to unlock the operation.
@@ -370,7 +370,8 @@ public final class PingPongTransactionChain implements DOMTransactionChain {
     @Override
     public synchronized void close() {
         final PingPongTransaction notLocked = lockedTx;
-        Preconditions.checkState(notLocked == null, "Attempted to close chain with outstanding transaction %s", notLocked);
+        Preconditions.checkState(notLocked == null, "Attempted to close chain with outstanding transaction %s",
+                notLocked);
 
         // This is not reliable, but if we observe it to be null and the process has already completed,
         // the backend transaction chain will throw the appropriate error.
@@ -409,8 +410,8 @@ public final class PingPongTransactionChain implements DOMTransactionChain {
 
         return new DOMDataReadOnlyTransaction() {
             @Override
-            public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
-                    final YangInstanceIdentifier path) {
+            public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(
+                    final LogicalDatastoreType store, final YangInstanceIdentifier path) {
                 return tx.getTransaction().read(store, path);
             }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.