From b3322b35c1b4a6833ad5ac0a3c45d648fc0301f7 Mon Sep 17 00:00:00 2001 From: Kristian Stangeland Date: Thu, 28 Mar 2013 21:58:06 -0400 Subject: [PATCH] Prevent ConcurrentModifcationExceptions. See http://pastebin.com/UBvGSFs9/ --- .../protocol/reflect/compiler/BackgroundCompiler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.java b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.java index 836a45d1..26c937ea 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/compiler/BackgroundCompiler.java @@ -198,6 +198,11 @@ public class BackgroundCompiler { synchronized (listenerLock) { list = listeners.get(key); + + // Prevent ConcurrentModificationExceptions + if (list != null) { + list = Lists.newArrayList(list); + } } // Only execute the listeners if there is a list