From a5b5d9b7882531440d4c7335cd917b1e00075bc1 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 28 Apr 2022 09:54:33 +0200 Subject: [PATCH] Fix a nullability warning in PingPongTransactionChain Eclipse is flagging multiple accessed to the same field. The field cannot move on us, but use a local variable to make the value invariant. Change-Id: I81599fecc77861d5011e45fa336c554e412f87dc Signed-off-by: Robert Varga (cherry picked from commit 069b1e6e991e6d6ebe99621d201984a01c36bab0) --- .../mdsal/dom/spi/PingPongTransactionChain.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/PingPongTransactionChain.java b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/PingPongTransactionChain.java index 1cda6b08f5..ec2b5a2d5e 100644 --- a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/PingPongTransactionChain.java +++ b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/PingPongTransactionChain.java @@ -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; } } -- 2.36.6