From: Robert Varga Date: Wed, 10 Nov 2021 09:50:50 +0000 (+0100) Subject: Clean up AbstractTransactionContextFactory X-Git-Tag: v4.0.7~36 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=f5320e13c4fbc566af3ff6f8aae032cdd80a5001;hp=bf54edf4eb5fffb48e005d07a0a20c8971b77a99 Clean up AbstractTransactionContextFactory Add a few @NonNull annotations and eliminate two else blocks. Change-Id: Ide21c363f349af7b24fb4835b859a224357586c8 Signed-off-by: Robert Varga --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java index 29b52f7557..6941d1904c 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractTransactionContextFactory.java @@ -41,8 +41,8 @@ abstract class AbstractTransactionContextFactory knownLocal = new ConcurrentHashMap<>(); - private final LocalHistoryIdentifier historyId; - private final ActorUtils actorUtils; + private final @NonNull LocalHistoryIdentifier historyId; + private final @NonNull ActorUtils actorUtils; // Used via TX_COUNTER_UPDATER @SuppressWarnings("unused") @@ -94,14 +94,14 @@ abstract class AbstractTransactionContextFactory maybe = findPrimaryFuture.value().get(); if (maybe.isSuccess()) { - return maybeCreateDirectTransactionContextWrapper(maybe.get(), parent, shardName, - contextWrapper); - } else { - onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName, - contextWrapper); + return maybeCreateDirectTransactionContextWrapper(maybe.get(), parent, shardName, contextWrapper); } + + onFindPrimaryShardFailure(maybe.failed().get(), parent, shardName, contextWrapper); } else { findPrimaryFuture.onComplete(result -> { if (result.isSuccess()) {