diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/AppletDesc.java | 2 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/Launcher.java | 8 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 4 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 5 |
5 files changed, 17 insertions, 13 deletions
@@ -1,3 +1,14 @@ +2011-09-28 Omair Majid <[email protected]> + + * netx/net/sourceforge/jnlp/AppletDesc.java (getMainClass): Clarify the + return value in javadoc. + * netx/net/sourceforge/jnlp/Launcher.java + (createApplet, createAppletObject): Do not replace '/' with '.'. + * netx/net/sourceforge/jnlp/PluginBridge.java (PluginBridge): Ensure that + the class name is in the dot-separated from. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (checkForMain): Ensure that the name is an exact match. + 2011-09-28 Deepak Bhole <[email protected]> PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path diff --git a/netx/net/sourceforge/jnlp/AppletDesc.java b/netx/net/sourceforge/jnlp/AppletDesc.java index d5e492a..da8021e 100644 --- a/netx/net/sourceforge/jnlp/AppletDesc.java +++ b/netx/net/sourceforge/jnlp/AppletDesc.java @@ -73,7 +73,7 @@ public class AppletDesc { } /** - * Returns the main class name + * Returns the main class name in the dot-separated form (eg: foo.bar.Baz) */ public String getMainClass() { return mainClass; diff --git a/netx/net/sourceforge/jnlp/Launcher.java b/netx/net/sourceforge/jnlp/Launcher.java index 988650b..1c99e29 100644 --- a/netx/net/sourceforge/jnlp/Launcher.java +++ b/netx/net/sourceforge/jnlp/Launcher.java @@ -704,10 +704,6 @@ public class Launcher { ThreadGroup group = Thread.currentThread().getThreadGroup(); String appletName = file.getApplet().getMainClass(); - - //Classloader chokes if there's '/' in the path to the main class. - //Must replace with '.' instead. - appletName = appletName.replace('/', '.'); Class appletClass = loader.loadClass(appletName); Applet applet = (Applet) appletClass.newInstance(); @@ -744,10 +740,6 @@ public class Launcher { } String appletName = file.getApplet().getMainClass(); - - //Classloader chokes if there's '/' in the path to the main class. - //Must replace with '.' instead. - appletName = appletName.replace('/', '.'); Class appletClass = loader.loadClass(appletName); Applet applet = (Applet) appletClass.newInstance(); diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java index a54858a..ac703b3 100644 --- a/netx/net/sourceforge/jnlp/PluginBridge.java +++ b/netx/net/sourceforge/jnlp/PluginBridge.java @@ -133,7 +133,9 @@ public class PluginBridge extends JNLPFile { if (main.endsWith(".class")) main = main.substring(0, main.length() - 6); - launchType = new AppletDesc(name, main, documentBase, width, + // the class name should be of the form foo.bar.Baz not foo/bar/Baz + String mainClass = main.replace('/', '.'); + launchType = new AppletDesc(name, mainClass, documentBase, width, height, atts); if (main.endsWith(".class")) //single class file only diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index 03e3763..412fb21 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -580,6 +580,7 @@ public class JNLPClassLoader extends URLClassLoader { mainClass = ad.getMainClass(); } else return; + String desiredJarEntryName = mainClass + ".class"; for (int i = 0; i < jars.size(); i++) { @@ -599,9 +600,7 @@ public class JNLPClassLoader extends URLClassLoader { while (entries.hasMoreElements()) { je = entries.nextElement(); String jeName = je.getName().replaceAll("/", "."); - - if (!jeName.startsWith(mainClass + "$Inner") - && (jeName.startsWith(mainClass) && jeName.endsWith(".class"))) { + if (jeName.equals(desiredJarEntryName)) { foundMainJar = true; verifySignedJNLP(jars.get(i), jarFile); break; |