Avoid ConcurrentModificationException by using SynchronizedMultimap
Change-Id: Ic49ac1d63d600e685d150fa4e94132a403189c84
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
index 731090d..90aafdd 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp4HandlerImpl.java
@@ -20,6 +20,7 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
import com.google.common.collect.Sets;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
@@ -170,7 +171,7 @@
protected HostProviderService providerService;
protected ApplicationId appId;
- protected Multimap<DeviceId, VlanId> ignoredVlans = HashMultimap.create();
+ protected Multimap<DeviceId, VlanId> ignoredVlans = Multimaps.synchronizedMultimap(HashMultimap.create());
private InternalHostListener hostListener = new InternalHostListener();
private List<DhcpServerInfo> defaultServerInfoList = new CopyOnWriteArrayList<>();
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
index 0fed65a..9d13a05 100644
--- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
+++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerImpl.java
@@ -19,6 +19,7 @@
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Deactivate;
import com.google.common.collect.Sets;
@@ -192,7 +193,7 @@
protected HostProviderService providerService;
protected ApplicationId appId;
- protected Multimap<DeviceId, VlanId> ignoredVlans = HashMultimap.create();
+ protected Multimap<DeviceId, VlanId> ignoredVlans = Multimaps.synchronizedMultimap(HashMultimap.create());
private InternalHostListener hostListener = new InternalHostListener();
private Boolean dhcpFpmEnabled = false;
private Dhcp6HandlerUtil dhcp6HandlerUtil = new Dhcp6HandlerUtil();