From: David ‘Bombe’ Roden Date: Fri, 1 Apr 2011 22:27:55 +0000 (+0200) Subject: Use a different List implementation to prevent concurrent modifications. X-Git-Tag: 0.6^2~16 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2f12691cfd310bd5a0fbeb4fd43250a3879675ea;p=Sone.git Use a different List implementation to prevent concurrent modifications. --- 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.