aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Su <[email protected]>2011-06-08 16:12:38 -0400
committerAndrew Su <[email protected]>2011-06-08 16:12:38 -0400
commit5d7c7a2009f1ccdc91cc5038cfd79d3f51a4ca4a (patch)
tree4e0a81fe06155747036abf73e3f5f078a26fc5bd
parent57a1d6169ce4b03610a1ba56567821f16cf661ce (diff)
Change jar resource names to be stored in HashSet instead of String[].
-rw-r--r--ChangeLog7
-rw-r--r--netx/net/sourceforge/jnlp/PluginBridge.java21
2 files changed, 21 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 198668c..ffe1c72 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-08 Andrew Su <[email protected]>
+
+ * netx/net/sourceforge/jnlp/PluginBridge.java:
+ (jars): Changed to use HashSet instead of String[].
+ (PluginBridge): Updated to work with HashSet instead of String[]
+ (getResources): Likewise.
+
2011-06-08 Deepak Bhole <[email protected]>
PR721: IcedTeaPlugin.so cannot run g_main_context_iteration on a different
diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java
index f4cfa1e..3423318 100644
--- a/netx/net/sourceforge/jnlp/PluginBridge.java
+++ b/netx/net/sourceforge/jnlp/PluginBridge.java
@@ -24,7 +24,9 @@ package net.sourceforge.jnlp;
import java.net.URL;
import java.net.MalformedURLException;
+import java.util.HashSet;
import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Locale;
import java.util.List;
import java.util.ArrayList;
@@ -35,7 +37,7 @@ import net.sourceforge.jnlp.runtime.JNLPRuntime;
public class PluginBridge extends JNLPFile {
String name;
- String[] jars = new String[0];
+ HashSet<String> jars = new HashSet<String>();
String[] cacheJars = new String[0];
String[] cacheExJars = new String[0];
Hashtable<String, String> atts;
@@ -101,11 +103,13 @@ public class PluginBridge extends JNLPFile {
}
if (jar != null && jar.length() > 0) {
- this.jars = jar.split(",");
+ String[] jars = jar.split(",");
// trim white spaces
- for (int i = 0; i < this.jars.length; i++) {
- this.jars[i] = this.jars[i].trim();
+ for (int i = 0; i < jars.length; i++) {
+ String jarName = jars[i].trim();
+ if (jarName.length() > 0)
+ this.jars.add(jarName);
}
if (JNLPRuntime.isDebug()) {
@@ -191,10 +195,13 @@ public class PluginBridge extends JNLPFile {
List<JARDesc> jarDescs = new ArrayList<JARDesc>();
jarDescs.addAll(sharedResources.getResources(JARDesc.class));
- for (int i = 0; i < jars.length; i++)
- if (jars[i].length() > 0)
- jarDescs.add(new JARDesc(new URL(codeBase, jars[i]),
+ Iterator<String> it = jars.iterator();
+ while(it.hasNext()) {
+ String name = it.next();
+ if (name.length() > 0)
+ jarDescs.add(new JARDesc(new URL(codeBase, name),
null, null, false, true, false, true));
+ }
boolean cacheable = true;