Guard against null transaction IDs 25/31425/1
authorRobert Varga <rovarga@cisco.com>
Wed, 16 Dec 2015 13:55:09 +0000 (14:55 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 16 Dec 2015 13:56:15 +0000 (14:56 +0100)
This pushes down the null guards so that we can track down the source of
nulls.

Change-Id: Id94db7ba1810b2331f625f335ee610b3a22b3c44
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ForwardedReadyTransaction.java

index 4f59f9feb52a5da87310d8d5e442bd2ca4dcf6b8..6597ce365c102fa0f8c639ae85331bd4d475f9ff 100644 (file)
@@ -58,7 +58,7 @@ public abstract class ShardTransaction extends AbstractUntypedActorWithMetering
         super("shard-tx"); //actor name override used for metering. This does not change the "real" actor name
         this.shardActor = shardActor;
         this.shardStats = shardStats;
-        this.transactionID = transactionID;
+        this.transactionID = Preconditions.checkNotNull(transactionID);
         this.clientTxVersion = clientTxVersion;
     }
 
@@ -164,7 +164,7 @@ public abstract class ShardTransaction extends AbstractUntypedActorWithMetering
             this.shardActor = shardActor;
             this.shardStats = shardStats;
             this.datastoreContext = datastoreContext;
-            this.transactionID = transactionID;
+            this.transactionID = Preconditions.checkNotNull(transactionID);
             this.txnClientVersion = txnClientVersion;
             this.type = type;
         }
index ea3caef093320ab1b9c4aa7d27e74df2f144b102..21f16e7bfeef07bf1c64ec97baa33b683420a216 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.controller.cluster.datastore.messages;
 
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
 import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
 
@@ -32,7 +33,7 @@ public class CreateTransaction implements SerializableMessage {
 
     private CreateTransaction(String transactionId, int transactionType, String transactionChainId,
             short version) {
-        this.transactionId = transactionId;
+        this.transactionId = Preconditions.checkNotNull(transactionId);
         this.transactionType = transactionType;
         this.transactionChainId = transactionChainId;
         this.version = version;
index b3d7f2c2d6dea96c5fd507c573ab723983227b1c..e30d2055c904a63b4d9410f1f3da91d0cd265500 100644 (file)
@@ -25,7 +25,7 @@ public class ForwardedReadyTransaction {
     public ForwardedReadyTransaction(String transactionID, short txnClientVersion,
             ReadWriteShardDataTreeTransaction transaction, boolean returnSerialized,
             boolean doImmediateCommit) {
-        this.transactionID = transactionID;
+        this.transactionID = Preconditions.checkNotNull(transactionID);
         this.transaction = Preconditions.checkNotNull(transaction);
         this.returnSerialized = returnSerialized;
         this.txnClientVersion = txnClientVersion;