From 794142ee36e01f4e5f3daf2268ec1beeb7f80f32 Mon Sep 17 00:00:00 2001 From: Oleg Sukhodolsky Date: Thu, 13 Mar 2008 16:51:04 +0300 Subject: [PATCH] 6636331: ConcurrentModificationException in AppContext code Added synchronization to AppContext.getAppContexts() Reviewed-by: art --- jdk/src/share/classes/sun/awt/AppContext.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/sun/awt/AppContext.java b/jdk/src/share/classes/sun/awt/AppContext.java index 0370f8333a3..901be0b9a1b 100644 --- a/jdk/src/share/classes/sun/awt/AppContext.java +++ b/jdk/src/share/classes/sun/awt/AppContext.java @@ -146,7 +146,9 @@ public final class AppContext { * Returns a set containing all AppContexts. */ public static Set getAppContexts() { - return new HashSet(threadGroup2appContext.values()); + synchronized (threadGroup2appContext) { + return new HashSet(threadGroup2appContext.values()); + } } /* The main "system" AppContext, used by everything not otherwise