X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FRemoteTransactionContextSupport.java;h=b32ef452756ddb689803fda8b4b60c8135cad793;hp=333d11b4f05ce03e4bca41e1f7727dc5e31fe279;hb=e84f63ee098fff5b02cbce1281ca0d1208f966fa;hpb=9f147ebcda515aa8c4c0bf6cb53a05ef7a7e626d diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java index 333d11b4f0..b32ef45275 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/RemoteTransactionContextSupport.java @@ -14,7 +14,6 @@ import akka.actor.ActorSelection; import akka.dispatch.OnComplete; import akka.pattern.AskTimeoutException; import akka.util.Timeout; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.concurrent.TimeUnit; import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; import org.opendaylight.controller.cluster.datastore.exceptions.NoShardLeaderException; @@ -100,7 +99,7 @@ final class RemoteTransactionContextSupport { * Sets the target primary shard and initiates a CreateTransaction try. */ void setPrimaryShard(final PrimaryShardInfo newPrimaryShardInfo) { - this.primaryShardInfo = newPrimaryShardInfo; + primaryShardInfo = newPrimaryShardInfo; if (getTransactionType() == TransactionType.WRITE_ONLY && getActorUtils().getDatastoreContext().isWriteOnlyTransactionOptimizationsEnabled()) { @@ -131,7 +130,7 @@ final class RemoteTransactionContextSupport { Future createTxFuture = getActorUtils().executeOperationAsync( primaryShardInfo.getPrimaryShardActor(), serializedCreateMessage, createTxMessageTimeout); - createTxFuture.onComplete(new OnComplete() { + createTxFuture.onComplete(new OnComplete<>() { @Override public void onComplete(final Throwable failure, final Object response) { onCreateTransactionComplete(failure, response); @@ -142,7 +141,7 @@ final class RemoteTransactionContextSupport { private void tryFindPrimaryShard() { LOG.debug("Tx {} Retrying findPrimaryShardAsync for shard {}", getIdentifier(), shardName); - this.primaryShardInfo = null; + primaryShardInfo = null; Future findPrimaryFuture = getActorUtils().findPrimaryShardAsync(shardName); findPrimaryFuture.onComplete(new OnComplete() { @Override @@ -152,11 +151,9 @@ final class RemoteTransactionContextSupport { }, getActorUtils().getClientDispatcher()); } - @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", - justification = "https://github.com/spotbugs/spotbugs/issues/811") private void onFindPrimaryShardComplete(final Throwable failure, final PrimaryShardInfo newPrimaryShardInfo) { if (failure == null) { - this.primaryShardInfo = newPrimaryShardInfo; + primaryShardInfo = newPrimaryShardInfo; tryCreateTransaction(); } else { LOG.debug("Tx {}: Find primary for shard {} failed", getIdentifier(), shardName, failure);