From 2f12691cfd310bd5a0fbeb4fd43250a3879675ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 2 Apr 2011 00:27:55 +0200 Subject: [PATCH 1/1] Use a different List implementation to prevent concurrent modifications. --- src/main/java/net/pterodactylus/sone/notify/ListNotification.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index c7e5b7c..2f43c58 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -18,8 +18,8 @@ package net.pterodactylus.sone.notify; import java.util.ArrayList; -import java.util.Collections; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import net.pterodactylus.util.notify.TemplateNotification; import net.pterodactylus.util.template.Template; @@ -34,7 +34,7 @@ import net.pterodactylus.util.template.Template; public class ListNotification extends TemplateNotification { /** The list of new elements. */ - private final List elements = Collections.synchronizedList(new ArrayList()); + private final List elements = new CopyOnWriteArrayList(); /** * Creates a new list notification. -- 2.7.4