diff options
author | Jiri Vanek <[email protected]> | 2013-11-25 10:16:42 +0100 |
---|---|---|
committer | Jiri Vanek <[email protected]> | 2013-11-25 10:16:42 +0100 |
commit | 18e9c2de7a762336e0b558f3007340d5eb2e9e44 (patch) | |
tree | cc477333b9508fa01100d1bab0469a0d6b5d7af3 /netx | |
parent | b8bf378b9b7887e273c4aa86aad85ecfd2f28b1f (diff) |
fix to ManifestedJar1Test cases
* netx/net/sourceforge/jnlp/ResourcesDesc.java: (getMainJAR) throw an RuntimeException when more then one main jar is specified. Preventing app to start.
* tests/reproducers/simple/ManifestedJar1/testcases/ManifestedJar1Test.java:(manifestedJar1main2mainNoAppDesc), (manifestedJar1nothing2nothingAppDesc)fixed and adapted to change.
Diffstat (limited to 'netx')
-rw-r--r-- | netx/net/sourceforge/jnlp/ResourcesDesc.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/netx/net/sourceforge/jnlp/ResourcesDesc.java b/netx/net/sourceforge/jnlp/ResourcesDesc.java index 988c55b..a63c3b0 100644 --- a/netx/net/sourceforge/jnlp/ResourcesDesc.java +++ b/netx/net/sourceforge/jnlp/ResourcesDesc.java @@ -72,11 +72,20 @@ public class ResourcesDesc { } public static JARDesc getMainJAR(List<JARDesc> jars) { + JARDesc markedMain = null; for (JARDesc jar : jars) { if (jar.isMain()) { - return jar; + 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; + } if (jars.size() > 0) { return jars.get(0); |