diff options
author | Adam Domurad <[email protected]> | 2012-07-10 10:35:52 -0400 |
---|---|---|
committer | Adam Domurad <[email protected]> | 2012-07-10 10:35:52 -0400 |
commit | b70936939cf57d11448538dbbcb5ecc535a603dc (patch) | |
tree | d5b191c9f887ae54af64138ac75c40f3d0bbf623 /netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | |
parent | d61edd76c23e6a1e85a117f39c77ae6a9ac5f8ca (diff) |
Refactor Object launchType; to LaunchDesc launchType; in JNLPFile
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index 83ffcb5..86eda20 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -67,6 +67,7 @@ import net.sourceforge.jnlp.JARDesc; import net.sourceforge.jnlp.JNLPFile; import net.sourceforge.jnlp.JNLPMatcher; import net.sourceforge.jnlp.JNLPMatcherException; +import net.sourceforge.jnlp.LaunchDesc; import net.sourceforge.jnlp.LaunchException; import net.sourceforge.jnlp.ParseException; import net.sourceforge.jnlp.PluginBridge; @@ -636,8 +637,7 @@ public class JNLPClassLoader extends URLClassLoader { // If jar with main class was not found and there are no more // available jars, throw a LaunchException - if (file.getLaunchInfo() instanceof AppletDesc || - file.getLaunchInfo() instanceof ApplicationDesc) { + if (file.getLaunchInfo() != null) { if (!foundMainJar && (available == null || available.size() == 0)) throw new LaunchException(file, null, R("LSFatal"), @@ -729,17 +729,14 @@ public class JNLPClassLoader extends URLClassLoader { */ private void checkForMain(List<JARDesc> jars) throws LaunchException { + // Check launch info if (mainClass == null) { - Object obj = file.getLaunchInfo(); - - if (obj instanceof ApplicationDesc) { - ApplicationDesc ad = (ApplicationDesc) file.getLaunchInfo(); - mainClass = ad.getMainClass(); - } else if (obj instanceof AppletDesc) { - AppletDesc ad = (AppletDesc) file.getLaunchInfo(); - mainClass = ad.getMainClass(); - } else + LaunchDesc launchDesc = file.getLaunchInfo(); + if (launchDesc == null) { return; + } + + mainClass = launchDesc.getMainClass(); } // The main class may be specified in the manifest |