X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fnetworkanalyzer%2FPceOtnNode.java;h=ec1043fc123a27887a32f41bd14d97381f53fe30;hb=bc9a08be9d7cdeb30ecffd3c82ddd656a3a23043;hp=c431d8b6f0a94174fc69662f105831bbe4e5f46d;hpb=a01f4032cd7dc71e3f047db5b3e2db77c4733b2c;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java index c431d8b6f..ec1043fc1 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceOtnNode.java @@ -101,9 +101,9 @@ public class PceOtnNode implements PceNode { = this.node.augmentation(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang .ietf.network.topology.rev180226.Node1.class); List allTps = new ArrayList(nodeTp.getTerminationPoint().values()); + .node.TerminationPoint> allTps = new ArrayList<>(nodeTp.nonnullTerminationPoint().values()); this.valid = false; - if (allTps == null) { + if (allTps.isEmpty()) { LOG.error("PceOtnNode: initXndrTps: XPONDER TerminationPoint list is empty for node {}", this); return; } @@ -188,8 +188,8 @@ public class PceOtnNode implements PceNode { for (TpId nwTp : netwTps) { for (TpId clTp : clientTps) { @Nullable - List nblList = new ArrayList(node.augmentation(Node1.class).getSwitchingPools() - .getOduSwitchingPools().values().stream().findFirst().get().getNonBlockingList().values()); + List nblList = new ArrayList<>(node.augmentation(Node1.class).getSwitchingPools() + .nonnullOduSwitchingPools().values().stream().findFirst().get().getNonBlockingList().values()); for (NonBlockingList nbl : nblList) { if (nbl.getTpList().contains(clTp) && nbl.getTpList().contains(nwTp)) { usableXpdrClientTps.add(clTp); @@ -207,8 +207,8 @@ public class PceOtnNode implements PceNode { if (clientTps == null && netwTps != null && nbClient == 0 && nbNetw == 2) { netwTps.sort(Comparator.comparing(TpId::getValue)); @Nullable - List nblList = new ArrayList(node.augmentation(Node1.class).getSwitchingPools() - .getOduSwitchingPools().values().stream().findFirst().get().getNonBlockingList().values()); + List nblList = new ArrayList<>(node.augmentation(Node1.class).getSwitchingPools() + .nonnullOduSwitchingPools().values().stream().findFirst().get().getNonBlockingList().values()); for (NonBlockingList nbl : nblList) { for (TpId nwTp : netwTps) { if (nbl.getTpList().contains(nwTp)) { @@ -306,9 +306,9 @@ public class PceOtnNode implements PceNode { node.augmentation( org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev181130.Node1.class); SwitchingPools sp = node1.getSwitchingPools(); - List osp = new ArrayList(sp.getOduSwitchingPools().values()); + List osp = new ArrayList<>(sp.nonnullOduSwitchingPools().values()); for (OduSwitchingPools ospx : osp) { - List nbl = new ArrayList(ospx.getNonBlockingList().values()); + List nbl = new ArrayList<>(ospx.nonnullNonBlockingList().values()); for (NonBlockingList nbll : nbl) { if (nbll.getAvailableInterconnectBandwidth().toJava() >= neededBW && nbll.getTpList() != null && nbll.getTpList().contains(tp1.getTpId()) && nbll.getTpList().contains(tp2.getTpId())) {