Ray Milkey
Committed by Gerrit Code Review

Fix ConcorrentModifcationException in statistics map

Change-Id: I46746afccb0d49277d365589fa7ae550b7c2acb1
...@@ -121,6 +121,7 @@ import org.projectfloodlight.openflow.types.PortSpeed; ...@@ -121,6 +121,7 @@ import org.projectfloodlight.openflow.types.PortSpeed;
121 import org.slf4j.Logger; 121 import org.slf4j.Logger;
122 122
123 import com.google.common.base.Strings; 123 import com.google.common.base.Strings;
124 +import com.google.common.collect.ImmutableList;
124 import com.google.common.collect.Lists; 125 import com.google.common.collect.Lists;
125 import com.google.common.collect.Maps; 126 import com.google.common.collect.Maps;
126 import com.google.common.collect.Sets; 127 import com.google.common.collect.Sets;
...@@ -313,7 +314,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -313,7 +314,8 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
313 314
314 private void pushPortMetrics(Dpid dpid, List<OFPortStatsEntry> portStatsEntries) { 315 private void pushPortMetrics(Dpid dpid, List<OFPortStatsEntry> portStatsEntries) {
315 DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid)); 316 DeviceId deviceId = DeviceId.deviceId(Dpid.uri(dpid));
316 - Collection<PortStatistics> stats = buildPortStatistics(deviceId, portStatsEntries); 317 + Collection<PortStatistics> stats =
318 + buildPortStatistics(deviceId, ImmutableList.copyOf(portStatsEntries));
317 providerService.updatePortStatistics(deviceId, stats); 319 providerService.updatePortStatistics(deviceId, stats);
318 } 320 }
319 321
......