aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge
diff options
context:
space:
mode:
authorDenis Lila <[email protected]>2011-04-18 15:13:23 -0400
committerDenis Lila <[email protected]>2011-04-18 15:13:23 -0400
commit3614db44151bb47e747226e5bd49d30bb9620e96 (patch)
treea7b0824d99a74a3023c003b759caf45c48d638ef /netx/net/sourceforge
parent885d877ae21a62a166b8ad2daa8274f8fec34094 (diff)
Fix concurrent classloading problem in JNLPClassLoader.loadClass.
Diffstat (limited to 'netx/net/sourceforge')
-rw-r--r--netx/net/sourceforge/jnlp/Launcher.java1
-rw-r--r--netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java6
2 files changed, 4 insertions, 3 deletions
diff --git a/netx/net/sourceforge/jnlp/Launcher.java b/netx/net/sourceforge/jnlp/Launcher.java
index cb443bd..2c0af48 100644
--- a/netx/net/sourceforge/jnlp/Launcher.java
+++ b/netx/net/sourceforge/jnlp/Launcher.java
@@ -31,7 +31,6 @@ import java.util.Map;
import java.util.jar.JarFile;
import net.sourceforge.jnlp.cache.CacheUtil;
-import net.sourceforge.jnlp.cache.ResourceTracker;
import net.sourceforge.jnlp.cache.UpdatePolicy;
import net.sourceforge.jnlp.runtime.AppThreadGroup;
import net.sourceforge.jnlp.runtime.AppletInstance;
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
index b90362a..13de695 100644
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
@@ -650,6 +650,7 @@ public class JNLPClassLoader extends URLClassLoader {
protected void activateJars(final List<JARDesc> jars) {
PrivilegedAction<Void> activate = new PrivilegedAction<Void>() {
+ @SuppressWarnings("deprecation")
public Void run() {
// transfer the Jars
waitForJars(jars);
@@ -983,7 +984,7 @@ public class JNLPClassLoader extends URLClassLoader {
* classloader, or one of the classloaders for the JNLP file's
* extensions.
*/
- public Class<?> loadClass(String name) throws ClassNotFoundException {
+ public synchronized Class<?> loadClass(String name) throws ClassNotFoundException {
Class<?> result = findLoadedClassAll(name);
@@ -1003,7 +1004,7 @@ public class JNLPClassLoader extends URLClassLoader {
// validPackage(name);
// search this and the extension loaders
- if (result == null)
+ if (result == null) {
try {
result = loadClassExt(name);
} catch (ClassNotFoundException cnfe) {
@@ -1060,6 +1061,7 @@ public class JNLPClassLoader extends URLClassLoader {
}
}
}
+ }
if (result == null) {
throw new ClassNotFoundException(name);