commit | 9280e191e35f37bbc04029d7d11b0d080d758c24 | [log] [tgz] |
---|---|---|
author | Thomas Vachuska <tom@opennetworking.org> | Tue Mar 06 11:19:29 2018 -0800 |
committer | Ray Milkey <ray@opennetworking.org> | Tue Mar 06 22:10:54 2018 +0000 |
tree | 7d5664e6b0d43663cd70d2a80cbea8cf8bd38bd1 | |
parent | e9ccf4196dac4da52b1306110a98ac3f6d4fe41f [diff] |
Fixed ConcurrentModificationException issue in LinkDiscovery code. Change-Id: I2dee31353c1c0a72a69f79409f30ab6b7ad1ae73
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 75458ab..735255b 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
@@ -68,6 +68,7 @@ private Timeout timeout; private volatile boolean isStopped; + // Set of ports to be probed private final HashMap<Long, String> portMap = Maps.newHashMap(); @@ -221,9 +222,7 @@ if (context.mastershipService().isLocalMaster(device.id())) { log.trace("Sending probes from {}", device.id()); - portMap.entrySet().forEach( - e -> sendProbes(e.getKey(), e.getValue()) - ); + portMap.forEach(this::sendProbes); } if (!isStopped()) {