X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2FRpcRegistry.java;h=bcb31990712b8a74f6503e320ff0d9089150d1b4;hb=refs%2Fchanges%2F77%2F84577%2F1;hp=68fead4407781f534b0f9b4aee3ae7e2b012f908;hpb=a28080b967656fe74811b56d9ff8070eab794ad1;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java index 68fead4407..bcb3199071 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java @@ -7,11 +7,13 @@ */ package org.opendaylight.controller.remote.rpc.registry; +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.Objects.requireNonNull; + import akka.actor.ActorRef; import akka.actor.Address; import akka.actor.Props; import com.google.common.annotations.VisibleForTesting; -import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; @@ -44,7 +46,7 @@ public class RpcRegistry extends BucketStoreActor { public RpcRegistry(final RemoteOpsProviderConfig config, final ActorRef rpcInvoker, final ActorRef rpcRegistrar) { super(config, config.getRpcRegistryPersistenceId(), new RoutingTable(rpcInvoker, ImmutableSet.of())); - this.rpcRegistrar = Preconditions.checkNotNull(rpcRegistrar); + this.rpcRegistrar = requireNonNull(rpcRegistrar); this.mxBean = new RemoteRpcRegistryMXBeanImpl(new BucketStoreAccess(self(), getContext().dispatcher(), config.getAskDuration()), config.getAskDuration()); } @@ -123,7 +125,7 @@ public class RpcRegistry extends BucketStoreActor { @VisibleForTesting public RemoteRpcEndpoint(final ActorRef router, final Collection rpcs) { - this.router = Preconditions.checkNotNull(router); + this.router = requireNonNull(router); this.rpcs = ImmutableSet.copyOf(rpcs); } @@ -144,7 +146,7 @@ public class RpcRegistry extends BucketStoreActor { final List rpcRouteIdentifiers; AbstractRouteMessage(final Collection rpcRouteIdentifiers) { - Preconditions.checkArgument(rpcRouteIdentifiers != null && !rpcRouteIdentifiers.isEmpty(), + checkArgument(rpcRouteIdentifiers != null && !rpcRouteIdentifiers.isEmpty(), "Route Identifiers must be supplied"); this.rpcRouteIdentifiers = ImmutableList.copyOf(rpcRouteIdentifiers); }