提交 0290f4a9 编写于 作者: S son

6636331: ConcurrentModificationException in AppContext code

Summary: Added synchronization to AppContext.getAppContexts()
Reviewed-by: art
上级 223f2c15
...@@ -146,8 +146,10 @@ public final class AppContext { ...@@ -146,8 +146,10 @@ public final class AppContext {
* Returns a set containing all <code>AppContext</code>s. * Returns a set containing all <code>AppContext</code>s.
*/ */
public static Set<AppContext> getAppContexts() { public static Set<AppContext> getAppContexts() {
synchronized (threadGroup2appContext) {
return new HashSet<AppContext>(threadGroup2appContext.values()); return new HashSet<AppContext>(threadGroup2appContext.values());
} }
}
/* The main "system" AppContext, used by everything not otherwise /* The main "system" AppContext, used by everything not otherwise
contained in another AppContext. contained in another AppContext.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册