diff options
Diffstat (limited to 'netx')
-rw-r--r-- | netx/net/sourceforge/jnlp/Parser.java | 21 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/ResourcesDesc.java | 13 |
2 files changed, 14 insertions, 20 deletions
diff --git a/netx/net/sourceforge/jnlp/Parser.java b/netx/net/sourceforge/jnlp/Parser.java index 310b306..4043fa6 100644 --- a/netx/net/sourceforge/jnlp/Parser.java +++ b/netx/net/sourceforge/jnlp/Parser.java @@ -250,13 +250,13 @@ class Parser { Node resources[] = getChildNodes(parent, "resources"); // ensure that there are at least one information section present - if (resources.length == 0 && !j2se) + if (resources.length == 0 && !j2se) { throw new ParseException(R("PNoResources")); - + } // create objects from the resources sections - for (int i = 0; i < resources.length; i++) + for (int i = 0; i < resources.length; i++) { result.add(getResourcesDesc(resources[i], j2se)); - + } return result; } @@ -302,9 +302,11 @@ class Parser { // check for duplicate main entries if (jar.isMain()) { - if (mainFlag == true) - if (strict) + if (mainFlag == true) { + if (strict) { throw new ParseException(R("PTwoMains")); + } + } mainFlag = true; } @@ -1073,10 +1075,11 @@ class Parser { URL result = new URL(base, href); // check for going above the codebase - if (!result.toString().startsWith(base.toString())) - if (strict) + if (!result.toString().startsWith(base.toString()) && !base.toString().startsWith(result.toString())){ + if (strict) { throw new ParseException(R("PUrlNotInCodebase", node.getNodeName(), href, base)); - + } + } return result; } diff --git a/netx/net/sourceforge/jnlp/ResourcesDesc.java b/netx/net/sourceforge/jnlp/ResourcesDesc.java index a63c3b0..0726851 100644 --- a/netx/net/sourceforge/jnlp/ResourcesDesc.java +++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java @@ -72,19 +72,10 @@ public class ResourcesDesc { } public static JARDesc getMainJAR(List<JARDesc> jars) { - JARDesc markedMain = null; for (JARDesc jar : jars) { if (jar.isMain()) { - if (markedMain == null){ - markedMain = jar; - } else { - //more then one main jar specified. It stinks. Return null to die later null; - throw new RuntimeException("Multiple main JARs specified, refusing to continue."); - } - } - } - if (markedMain!=null){ - return markedMain; + return jar; + } } if (jars.size() > 0) { |