Using nonNull API's in ELAN
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / listeners / HAOpNodeListener.java
index 038c73201309d4d0058b8cb5eb2ad48ca4c937a6..08d2785fbfb824df8f872f419591db9c2e49a351 100644 (file)
@@ -236,13 +236,14 @@ public class HAOpNodeListener extends HwvtepNodeBaseListener<Operational> implem
         String childGlobalNodeId = childNode.getNodeId().getValue();
         List<InstanceIdentifier> childPsIids = new ArrayList<>();
         HwvtepGlobalAugmentation hwvtepGlobalAugmentation = childNode.augmentation(HwvtepGlobalAugmentation.class);
-        if (hwvtepGlobalAugmentation == null || HwvtepHAUtil.isEmpty(hwvtepGlobalAugmentation.getSwitches().values())) {
+        if (hwvtepGlobalAugmentation == null
+            || HwvtepHAUtil.isEmpty(hwvtepGlobalAugmentation.nonnullSwitches().values())) {
             haOpClusteredListener.getConnectedNodes()
                     .stream()
                     .filter((connectedIid) -> IS_PS_CHILD_TO_GLOBAL_NODE.test(childGlobalNodeId, connectedIid))
                     .forEach(childPsIids::add);
         } else {
-            hwvtepGlobalAugmentation.getSwitches().values().forEach(
+            hwvtepGlobalAugmentation.nonnullSwitches().values().forEach(
                 (switches) -> childPsIids.add(switches.getSwitchRef().getValue()));
         }
         if (childPsIids.isEmpty()) {