import akka.actor.ActorSelection;
import akka.dispatch.OnComplete;
-import com.google.common.base.Supplier;
-import com.google.common.collect.Lists;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Supplier;
import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
import org.opendaylight.controller.cluster.datastore.messages.AbortTransaction;
import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply;
return returnFuture;
}
+ @SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD",
+ justification = "https://github.com/spotbugs/spotbugs/issues/811")
private void finishCanCommit(final SettableFuture<Boolean> returnFuture) {
LOG.debug("Tx {} finishCanCommit", transactionId);
}
private Future<Iterable<Object>> invokeCohorts(final MessageSupplier messageSupplier) {
- List<Future<Object>> futureList = Lists.newArrayListWithCapacity(cohorts.size());
+ List<Future<Object>> futureList = new ArrayList<>(cohorts.size());
for (CohortInfo cohort : cohorts) {
Object message = messageSupplier.newMessage(transactionId, cohort.getActorVersion());
static class CohortInfo {
private final Future<ActorSelection> actorFuture;
- private volatile ActorSelection resolvedActor;
private final Supplier<Short> actorVersionSupplier;
+ private volatile ActorSelection resolvedActor;
+
CohortInfo(final Future<ActorSelection> actorFuture, final Supplier<Short> actorVersionSupplier) {
this.actorFuture = actorFuture;
this.actorVersionSupplier = actorVersionSupplier;