diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 14:35:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:45:50 +0200 |
commit | 587c59fbc931b12f4d63d077a78bcaa43ffbf83d (patch) | |
tree | c1984991960664faf41ea3e32e3804404aecb22d /scripting/java/org/openoffice/idesupport/JavaFinder.java | |
parent | remove some unnecessary casts (diff) | |
download | core-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.tar.gz core-587c59fbc931b12f4d63d077a78bcaa43ffbf83d.zip |
Java cleanup, Convert Vector to ArrayList
Change-Id: I323a6625f93347e69f3114fc10cb04dc759a539f
Diffstat (limited to 'scripting/java/org/openoffice/idesupport/JavaFinder.java')
-rw-r--r-- | scripting/java/org/openoffice/idesupport/JavaFinder.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/scripting/java/org/openoffice/idesupport/JavaFinder.java b/scripting/java/org/openoffice/idesupport/JavaFinder.java index 8c0071844fe9..846481857848 100644 --- a/scripting/java/org/openoffice/idesupport/JavaFinder.java +++ b/scripting/java/org/openoffice/idesupport/JavaFinder.java @@ -20,14 +20,15 @@ package org.openoffice.idesupport; import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Vector; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; -import java.net.MalformedURLException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.openoffice.idesupport.zip.ParcelZipper; import com.sun.star.script.framework.container.ScriptEntry; @@ -41,11 +42,11 @@ public class JavaFinder implements MethodFinder { private static final String FIRST_PARAM = "drafts.com.sun.star.script.framework.runtime.XScriptContext"; - private Vector<String> classpath = null; + private List<String> classpath = null; private JavaFinder() {} - private JavaFinder(Vector<String> classpath) { + private JavaFinder(List<String> classpath) { this.classpath = classpath; } @@ -59,7 +60,7 @@ public class JavaFinder implements MethodFinder { return finder; } - public static JavaFinder getInstance(Vector<String> classpath) { + public static JavaFinder getInstance(List<String> classpath) { return new JavaFinder(classpath); } @@ -136,7 +137,7 @@ public class JavaFinder implements MethodFinder { for (int i = 0; i < len; i++) { try { - String s = classpath.elementAt(i); + String s = classpath.get(i); s = SVersionRCFile.toFileURL(s); if (s != null) @@ -154,10 +155,10 @@ public class JavaFinder implements MethodFinder { files.add(basedir); try { - Enumeration offices = SVersionRCFile.createInstance().getVersions(); + Iterator<OfficeInstallation> offices = SVersionRCFile.createInstance().getVersions(); - while (offices.hasMoreElements()) { - OfficeInstallation oi = (OfficeInstallation)offices.nextElement(); + while (offices.hasNext()) { + OfficeInstallation oi = offices.next(); String unoil = SVersionRCFile.getPathForUnoil(oi.getPath()); if (unoil != null) { |