# HG changeset patch # User pchelko # Date 1393342423 -14400 # Node ID 2a56d53a2a99ec5e67ac1ab71df0cb9139bb2a0b # Parent 550daf7361efab11d090d644626ba153f00c11f4 8028285: RMI Thread can no longer call out to AWT Reviewed-by: art, serb, ddehaven diff -r 550daf7361ef -r 2a56d53a2a99 src/share/classes/sun/awt/AppContext.java --- a/src/share/classes/sun/awt/AppContext.java Thu Feb 20 16:01:35 2014 +0400 +++ b/src/share/classes/sun/awt/AppContext.java Tue Feb 25 19:33:43 2014 +0400 @@ -323,6 +323,20 @@ while (context == null) { threadGroup = threadGroup.getParent(); if (threadGroup == null) { + // We've got up to the root thread group and did not find an AppContext + // Try to get it from the security manager + SecurityManager securityManager = System.getSecurityManager(); + if (securityManager != null) { + ThreadGroup smThreadGroup = securityManager.getThreadGroup(); + if (smThreadGroup != null) { + /* + * If we get this far then it's likely that + * the ThreadGroup does not actually belong + * to the applet, so do not cache it. + */ + return threadGroup2appContext.get(smThreadGroup); + } + } return null; } context = threadGroup2appContext.get(threadGroup);