Fix a nullability warning in PingPongTransactionChain
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / PingPongTransactionChain.java
index 1cda6b08f57de65feb225dff19ed5b622963ab86..ec2b5a2d5eacc3d4b7f70dc93061992217ca16df 100644 (file)
@@ -267,12 +267,15 @@ public final class PingPongTransactionChain implements DOMTransactionChain {
         checkState(success, "Completed transaction %s while %s was submitted", tx, inflightTx);
 
         final PingPongTransaction nextTx = READY_UPDATER.getAndSet(this, null);
-        if (nextTx != null) {
+        if (nextTx == null) {
+            final PingPongTransaction local = shutdownTx;
+            if (local != null) {
+                processTransaction(local);
+                delegate.close();
+                shutdownTx = null;
+            }
+        } else {
             processTransaction(nextTx);
-        } else if (shutdownTx != null) {
-            processTransaction(shutdownTx);
-            delegate.close();
-            shutdownTx = null;
         }
     }