- to prevent ConcurrentModificationException in
situation when List.stream() is called at same
time as List.clear()
JIRA: BGPCEP-829
Change-Id: I9e69971de5ec75ca515e81e2b95fe44e50489fda
Signed-off-by: Matej Perina <matej.perina@pantheon.tech>
import java.nio.file.WatchEvent;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;
-import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
import javax.annotation.concurrent.GuardedBy;
import org.junit.After;
import org.junit.Before;
public abstract class AbstractConfigLoader extends AbstractConcurrentDataBrokerTest {
@GuardedBy("this")
- private final List<WatchEvent<?>> eventList = new ArrayList<>();
+ private final List<WatchEvent<?>> eventList = new CopyOnWriteArrayList<>();
protected ConfigLoaderImpl configLoader;
@Mock
private WatchService watchService;