Simplify transactionAborted()
[mdsal.git] / dom / mdsal-dom-spi / src / main / java / org / opendaylight / mdsal / dom / spi / store / AbstractSnapshotBackedTransactionChain.java
index 0bd3cf3d7a17264898357bc4951195c4c1100483..543a86ec5f5cca92726a45d6f21092671366ac9e 100644 (file)
@@ -178,14 +178,10 @@ public abstract class AbstractSnapshotBackedTransactionChain<T>
     @Override
     protected final void transactionAborted(final SnapshotBackedWriteTransaction<T> tx) {
         final State localState = state;
-        if (localState instanceof Allocated allocated) {
-            if (allocated.getTransaction().equals(tx)) {
-                final boolean success = STATE_UPDATER.compareAndSet(this, localState, idleState);
-                if (!success) {
-                    LOG.warn("Transaction {} aborted, but chain {} state already transitioned from {} to {}, "
-                        + "very strange", tx, this, localState, state);
-                }
-            }
+        if (localState instanceof Allocated allocated && allocated.getTransaction().equals(tx)
+            && !STATE_UPDATER.compareAndSet(this, localState, idleState)) {
+            LOG.warn("Transaction {} aborted, but chain {} state already transitioned from {} to {}, very strange",
+                tx, this, localState, state);
         }
     }