From 41f3038f5d91f563ed46a95738111d70a724f9fb Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 8 May 2014 17:30:25 +0200 Subject: [PATCH] BUG-972: correct Precondition This is just a tiny adjustment of a Precondition, which should have been triggered before this access. isPresent() returns true/false, which will be autoboxed, so will always pass checkNotNull. use checkArgument() instead, which will ensure that isPresent() == true. Change-Id: I53fe6913c7a0f8073a193bc76c0792059c26fe2a Signed-off-by: Robert Varga --- .../controller/sal/connector/remoterpc/RemoteRpcProvider.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java index edcef83574..53fbb929bb 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/main/java/org/opendaylight/controller/sal/connector/remoterpc/RemoteRpcProvider.java @@ -8,7 +8,7 @@ package org.opendaylight.controller.sal.connector.remoterpc; -import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; import java.util.Collection; import java.util.Collections; @@ -174,7 +174,7 @@ public class RemoteRpcProvider implements Optional> routingTable = routingTableProvider.getRoutingTable(); - checkNotNull(routingTable.isPresent(), "Routing table is null"); + checkState(routingTable.isPresent(), "Routing table is null"); return routingTable.get(); } -- 2.36.6