HIGUCHI Yuta
Committed by Jonathan Hart

Fix ConcurrentModificationException in SnmpDeviceProviderTest

FAILURE org.onosproject.provider.snmp.device.impl.SnmpDeviceProviderTest testDeactivate:
java.util.ConcurrentModificationException
	at java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1625)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
	at org.onosproject.provider.snmp.device.impl.SnmpDeviceProvider.deactivate(SnmpDeviceProvider.java:140)
	at org.onosproject.provider.snmp.device.impl.SnmpDeviceProviderTest.testDeactivate(SnmpDeviceProviderTest.java:111)

Change-Id: Ie72ee2da15377d5eaa91a056c36035b38c014ae2
......@@ -24,14 +24,15 @@ import org.onosproject.snmp.SnmpDevice;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Test Adapter for SnmpController API.
*/
public class SnmpControllerAdapter implements SnmpController {
protected HashMap<DeviceId, SnmpDevice> devices = new HashMap<>();
protected Map<DeviceId, SnmpDevice> devices = new ConcurrentHashMap<>();
@Override
public Collection<SnmpDevice> getDevices() {
return devices.values();
......