/hg/icedtea-web: fix findbugs cloud jnlps
omajid at icedtea.classpath.org
omajid at icedtea.classpath.org
Fri Jan 6 09:17:46 PST 2012
changeset 0e524d940827 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=0e524d940827
author: Omair Majid <omajid at redhat.com>
date: Fri Jan 06 12:14:56 2012 -0500
fix findbugs cloud jnlps
Someone reported that the following JNLP was not starting:
http://findbugs.cs.umd.edu/cloud/eclipse.jnlp
The first problem was that icedtea-web was trying to ensure that all
jnlps, including extension jnlps have a main class. I wonder what
other applications were broken by this check. This patch modifies
the check to only check for main class when a main class is possible
(applets and applications).
The second second problem was that (in the extension jnlp file) the
jnlp element did not contain a codebase attribute. IcedTea-Web tried
to add this null codebase when merging the jnlp file, causing an
exception. The patch simply ignores this null.
2012-01-05 Omair Majid <omajid at redhat.com>
* netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
(initializeResources): Only throw exceptions about the main class
not being found when the jnlp file can have a main class.
(addToCodeBaseLoader): Dont try to process null URLs.
diffstat:
ChangeLog | 7 +++++++
netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 16 +++++++++++-----
2 files changed, 18 insertions(+), 5 deletions(-)
diffs (47 lines):
diff -r 64979652c3b7 -r 0e524d940827 ChangeLog
--- a/ChangeLog Thu Jan 05 17:33:06 2012 +0100
+++ b/ChangeLog Fri Jan 06 12:14:56 2012 -0500
@@ -1,3 +1,10 @@
+2012-01-05 Omair Majid <omajid at redhat.com>
+
+ * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
+ (initializeResources): Only throw exceptions about the main class not
+ being found when the jnlp file can have a main class.
+ (addToCodeBaseLoader): Dont try to process null URLs.
+
2011-12-15 Jiri Vanek <jvanek at redhat.com>
* configure.ac: added search for xsltproc program and setting
diff -r 64979652c3b7 -r 0e524d940827 netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java
--- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Thu Jan 05 17:33:06 2012 +0100
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java Fri Jan 06 12:14:56 2012 -0500
@@ -488,11 +488,14 @@
// If jar with main class was not found and there are no more
// available jars, throw a LaunchException
- if (!foundMainJar
- && (available == null || available.size() == 0))
- throw new LaunchException(file, null, R("LSFatal"),
- R("LCClient"), R("LCantDetermineMainClass"),
- R("LCantDetermineMainClassInfo"));
+ if (file.getLaunchInfo() instanceof AppletDesc ||
+ file.getLaunchInfo() instanceof ApplicationDesc) {
+ if (!foundMainJar
+ && (available == null || available.size() == 0))
+ throw new LaunchException(file, null, R("LSFatal"),
+ R("LCClient"), R("LCantDetermineMainClass"),
+ R("LCantDetermineMainClassInfo"));
+ }
// If main jar was found, but a signed JNLP file was not located
if (!isSignedJNLP && foundMainJar)
@@ -1700,6 +1703,9 @@
* @throws IllegalArgumentException If the given url is not a path
*/
private void addToCodeBaseLoader(URL u) {
+ if (u == null) {
+ return;
+ }
// Only paths may be added
if (!u.getFile().endsWith("/")) {
More information about the distro-pkg-dev
mailing list