From 7fd5e756aaed4ddea02db3d42e49feed86c1b839 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 12 May 2008 21:49:12 +0000 Subject: [PATCH] fix ConcurrentModificationException git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@854 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java index ac448a6..541e502 100644 --- a/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java +++ b/src/net/pterodactylus/fcp/highlevel/HighLevelCallback.java @@ -84,15 +84,17 @@ public class HighLevelCallback { } /** - * Notifies all listeners that the result of the operation is now known. + * Notifies all listeners that the result of the operation is now known. As + * soon as a listener was notified it will be removed from the list of + * listeners! * * @see HighLevelCallbackListener#gotResult(HighLevelCallback) */ private synchronized void fireGotResult() { for (HighLevelCallbackListener highLevelCallbackListener: highLevelCallbackListeners) { - highLevelCallbackListeners.remove(highLevelCallbackListener); highLevelCallbackListener.gotResult(this); } + highLevelCallbackListeners.clear(); } /** -- 2.7.4