Cleanup warnings
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / LocalTransactionFactoryImpl.java
index 7c05fef87fc6013aebeae533697fa6309bd9f8a8..d01cae8451451a0b5f35d5dc01f4fd10e789b932 100644 (file)
@@ -66,16 +66,17 @@ final class LocalTransactionFactoryImpl extends TransactionReadyPrototype<Transa
     }
 
     @Override
-    protected DOMStoreThreePhaseCommitCohort transactionReady(final SnapshotBackedWriteTransaction<TransactionIdentifier> tx,
-            final DataTreeModification tree) {
+    protected DOMStoreThreePhaseCommitCohort transactionReady(
+            final SnapshotBackedWriteTransaction<TransactionIdentifier> tx, final DataTreeModification tree) {
         return new LocalThreePhaseCommitCohort(actorContext, leader, tx, tree);
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked", "checkstyle:IllegalCatch"})
     @Override
     public LocalThreePhaseCommitCohort onTransactionReady(@Nonnull DOMStoreWriteTransaction tx,
             @Nullable Exception operationError) {
-        if(operationError != null) {
+        Preconditions.checkArgument(tx instanceof SnapshotBackedWriteTransaction);
+        if (operationError != null) {
             return new LocalThreePhaseCommitCohort(actorContext, leader,
                     (SnapshotBackedWriteTransaction<TransactionIdentifier>)tx, operationError);
         }