X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FCompositeDataTreeCohort.java;h=bca00ebc4a6bdbb88cd928ffe609bdb6ae1acd5f;hb=2a6aa1775604906755883f810ee9ea6d5f286135;hp=5e1add10a213fa4e1056ad7e7de026f0a534ff54;hpb=127042ea7e148d9dc0282acc3780b4754ca69e12;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CompositeDataTreeCohort.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CompositeDataTreeCohort.java index 5e1add10a2..bca00ebc4a 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CompositeDataTreeCohort.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/CompositeDataTreeCohort.java @@ -5,9 +5,11 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.controller.cluster.datastore; +import static com.google.common.base.Preconditions.checkState; +import static java.util.Objects.requireNonNull; + import akka.actor.ActorRef; import akka.actor.Status; import akka.actor.Status.Failure; @@ -17,7 +19,6 @@ import akka.dispatch.OnComplete; import akka.dispatch.Recover; import akka.pattern.Patterns; import akka.util.Timeout; -import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.AbstractMap.SimpleImmutableEntry; @@ -109,11 +110,11 @@ class CompositeDataTreeCohort { CompositeDataTreeCohort(final DataTreeCohortActorRegistry registry, final TransactionIdentifier transactionID, final SchemaContext schema, final Executor callbackExecutor, final Timeout timeout) { - this.registry = Preconditions.checkNotNull(registry); - this.txId = Preconditions.checkNotNull(transactionID); - this.schema = Preconditions.checkNotNull(schema); - this.callbackExecutor = Preconditions.checkNotNull(callbackExecutor); - this.timeout = Preconditions.checkNotNull(timeout); + this.registry = requireNonNull(registry); + this.txId = requireNonNull(transactionID); + this.schema = requireNonNull(schema); + this.callbackExecutor = requireNonNull(callbackExecutor); + this.timeout = requireNonNull(timeout); } void reset() { @@ -241,7 +242,8 @@ class CompositeDataTreeCohort { // FB issues violation for passing null to CompletableFuture#complete but it is valid and necessary when the // generic type is Void. - @SuppressFBWarnings("NP_NONNULL_PARAM_VIOLATION") + @SuppressFBWarnings(value = { "NP_NONNULL_PARAM_VIOLATION", "UPM_UNCALLED_PRIVATE_METHOD" }, + justification = "https://github.com/spotbugs/spotbugs/issues/811") private void processResponses(final Throwable failure, final Iterable results, final State currentState, final State afterState, final CompletableFuture resultFuture) { if (failure != null) { @@ -282,7 +284,7 @@ class CompositeDataTreeCohort { } void changeStateFrom(final State expected, final State followup) { - Preconditions.checkState(state == expected); + checkState(state == expected); state = followup; } }