Sonar suggestion - possible NPEs
Change-Id: I235cdb3ade09a774749a320a6399c9dd38761c4d
diff --git a/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java b/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
index 1e0e6fd..adfe3f1 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/grouphandler/DefaultGroupHandler.java
@@ -16,6 +16,7 @@
package org.onosproject.segmentrouting.grouphandler;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -472,13 +473,14 @@
// some store elements may not be hashed next-objectives - ignore them
if (isSimpleNextObjective(dskey)) {
+ Set<DeviceId> displayNextHops = nextHops == null ? ImmutableSet.of() : nextHops;
log.debug("Ignoring {} of SIMPLE nextObj for targetSw:{}"
+ " -> dstSw:{} with current nextHops:{} to new"
+ " nextHops: {} in nextId:{}",
(revoke) ? "removal" : "addition", targetSw, destSw,
currNeighbors, nextHops, nextId);
- if ((revoke && !nextHops.isEmpty())
- || (!revoke && !nextHops.equals(currNeighbors))) {
+ if ((revoke && !displayNextHops.isEmpty())
+ || (!revoke && !displayNextHops.equals(currNeighbors))) {
log.warn("Simple next objective cannot be edited to "
+ "move from {} to {}", currNeighbors, nextHops);
}