Sho SHIMIZU
Committed by Gerrit Code Review

Simplify condition

Change-Id: Ie67c897517167163d79fee613ce954a372810166
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
15 */ 15 */
16 package org.onosproject.segmentrouting.grouphandler; 16 package org.onosproject.segmentrouting.grouphandler;
17 17
18 +import static com.google.common.base.Preconditions.checkArgument;
18 import static org.slf4j.LoggerFactory.getLogger; 19 import static org.slf4j.LoggerFactory.getLogger;
19 20
20 import java.util.ArrayList; 21 import java.util.ArrayList;
...@@ -322,9 +323,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler { ...@@ -322,9 +323,7 @@ public class PolicyGroupHandler extends DefaultGroupHandler {
322 } 323 }
323 324
324 public void removeGroupChain(PolicyGroupIdentifier key) { 325 public void removeGroupChain(PolicyGroupIdentifier key) {
325 - if (!(key instanceof PolicyGroupIdentifier)) { 326 + checkArgument(key != null);
326 - throw new IllegalArgumentException();
327 - }
328 List<PolicyGroupIdentifier> groupsToBeDeleted = 327 List<PolicyGroupIdentifier> groupsToBeDeleted =
329 new ArrayList<PolicyGroupIdentifier>(); 328 new ArrayList<PolicyGroupIdentifier>();
330 groupsToBeDeleted.add(key); 329 groupsToBeDeleted.add(key);
......