commit | e3c454e1318e30c6b6fedcefd0f3a383d51df794 | [log] [tgz] |
---|---|---|
author | Ray Milkey <ray@opennetworking.org> | Wed Nov 14 10:47:50 2018 -0800 |
committer | Ray Milkey <ray@opennetworking.org> | Wed Nov 14 23:55:06 2018 +0000 |
tree | a926cf7e67a36e1407c87be294717f6b320dc66f | |
parent | c161f822edb6fb522dca778100ea488d25614715 [diff] |
Fix NPE in LinkDiscovery Change-Id: I4386877639fdc36dd8df26190a2cb7a3e16094e2
diff --git a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java index bea59ee..e79f58e 100644 --- a/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java +++ b/providers/lldpcommon/src/main/java/org/onosproject/provider/lldpcommon/LinkDiscovery.java
@@ -47,6 +47,7 @@ import java.nio.ByteBuffer; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.function.Supplier; import java.util.stream.Stream; @@ -332,7 +333,8 @@ DeviceService deviceService, Device remoteDevice) { Optional<Port> remotePort = deviceService.getPorts(remoteDevice.id()) - .stream().filter(port -> remotePortName.equals(port.annotations().value(AnnotationKeys.PORT_NAME))) + .stream().filter(port -> Objects.equals(remotePortName, + port.annotations().value(AnnotationKeys.PORT_NAME))) .findAny(); if (remotePort.isPresent()) {