MRI version bumpup for Aluminium
[netvirt.git] / elanmanager / impl / src / main / java / org / opendaylight / netvirt / elan / l2gw / ha / commands / TerminationPointCmd.java
index daf1ebe8ace719a522b9efcba2240dfe148b2df1..0d57aee5b43b2d12af2e2e736d12ed343fa5d37f 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.netvirt.elan.l2gw.ha.commands;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -36,8 +37,8 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
     @Override
     @Nullable
     public List<TerminationPoint> getData(Node node) {
-        if (node != null) {
-            return node.getTerminationPoint();
+        if (node != null && node.getTerminationPoint() != null) {
+            return new ArrayList<TerminationPoint>(node.getTerminationPoint().values());
         }
         return null;
     }
@@ -71,7 +72,7 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
                 new HwvtepPhysicalPortAugmentationBuilder(augmentation);
 
         if (augmentation.getVlanBindings() != null && augmentation.getVlanBindings().size() > 0) {
-            tpAugmentationBuilder.setVlanBindings(augmentation.getVlanBindings().stream().map(
+            tpAugmentationBuilder.setVlanBindings(augmentation.getVlanBindings().values().stream().map(
                 vlanBindings -> {
                     VlanBindingsBuilder vlanBindingsBuilder = new VlanBindingsBuilder(vlanBindings);
                     vlanBindingsBuilder.setLogicalSwitchRef(
@@ -108,8 +109,10 @@ public class TerminationPointCmd extends MergeCommand<TerminationPoint, NodeBuil
                 .augmentation(HwvtepPhysicalPortAugmentation.class);
         HwvtepPhysicalPortAugmentation origAugmentation = orig.augmentation(HwvtepPhysicalPortAugmentation.class);
 
-        List<VlanBindings> up = updatedAugmentation != null ? updatedAugmentation.getVlanBindings() : null;
-        List<VlanBindings> or = origAugmentation != null ? origAugmentation.getVlanBindings() : null;
+        List<VlanBindings> up
+                = updatedAugmentation != null ? new ArrayList<>(updatedAugmentation.getVlanBindings().values()) : null;
+        List<VlanBindings> or
+                = origAugmentation != null ? new ArrayList<>(origAugmentation.getVlanBindings().values()) : null;
         if (!areSameSize(up, or)) {
             return false;
         }