From 0b38becc8ddeb3026d5fa0ca89713cb3e38ac430 Mon Sep 17 00:00:00 2001 From: Deepak Bhole Date: Fri, 4 Mar 2011 17:34:32 -0500 Subject: - PR475, RH604061: Allow applets from the same page to use the same classloader --- netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java') diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java index fca019e..26eb799 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java @@ -199,8 +199,16 @@ class JNLPSecurityManager extends AWTSecurityManager { // this needs to be tightened up for (int i = 0; i < stack.length && i < maxDepth; i++) { - if (stack[i].getClassLoader() instanceof JNLPClassLoader) { - JNLPClassLoader loader = (JNLPClassLoader) stack[i].getClassLoader(); + ClassLoader cl = stack[i].getClassLoader(); + + // Since we want to deal with JNLPClassLoader, extract it if this + // is a codebase loader + if (cl instanceof JNLPClassLoader.CodeBaseClassLoader) + cl = ((JNLPClassLoader.CodeBaseClassLoader) cl).getParentJNLPClassLoader(); + + if (cl instanceof JNLPClassLoader) { + + JNLPClassLoader loader = (JNLPClassLoader) cl; if (loader != null && loader.getApplication() != null) { return loader.getApplication(); -- cgit v1.2.3