# HG changeset patch
# User son
# Date 1205416264 -10800
# Node ID c7ed16a1bef22fdf82f687697647ec87bf09376b
# Parent adfeae7879c211b155f466286ef356f7a818133f
6636331: ConcurrentModificationException in AppContext code
Summary: Added synchronization to AppContext.getAppContexts()
Reviewed-by: art
diff -r adfeae7879c2 -r c7ed16a1bef2 jdk/src/share/classes/sun/awt/AppContext.java
--- a/jdk/src/share/classes/sun/awt/AppContext.java Thu Mar 13 16:47:40 2008 +0300
+++ b/jdk/src/share/classes/sun/awt/AppContext.java Thu Mar 13 16:51:04 2008 +0300
@@ -146,7 +146,9 @@
* Returns a set containing all AppContext
s.
*/
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