diff options
author | rbuj <robert.buj@gmail.com> | 2014-09-10 12:39:29 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-09-11 06:11:48 +0000 |
commit | de1db03480c86aa386b5cff09c4eac0eddbadf53 (patch) | |
tree | b00f17c5d5d20dfc12df92e1087826945df041bd | |
parent | 2844128a9494c2877595b65ee01f4c099176cafa (diff) |
scripting: Pass a proper array equal to collection size.
Change-Id: I2c4c85b2da7b7037fc9da16793d18667b3d25503
Reviewed-on: https://gerrit.libreoffice.org/11375
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | scripting/java/org/openoffice/idesupport/CommandLineTools.java | 2 | ||||
-rw-r--r-- | scripting/java/org/openoffice/idesupport/JavaFinder.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/scripting/java/org/openoffice/idesupport/CommandLineTools.java b/scripting/java/org/openoffice/idesupport/CommandLineTools.java index 8e2b39776176..c47e2457c121 100644 --- a/scripting/java/org/openoffice/idesupport/CommandLineTools.java +++ b/scripting/java/org/openoffice/idesupport/CommandLineTools.java @@ -293,7 +293,7 @@ public class CommandLineTools { throw new Exception("No valid scripts found"); ParcelDescriptor desc = new ParcelDescriptor(parcelxml, language); - desc.setScriptEntries((ScriptEntry[])scripts.toArray(new ScriptEntry[0])); + desc.setScriptEntries((ScriptEntry[])scripts.toArray(new ScriptEntry[scripts.size()])); if (properties.size() != 0) { Enumeration enumer = properties.keys(); diff --git a/scripting/java/org/openoffice/idesupport/JavaFinder.java b/scripting/java/org/openoffice/idesupport/JavaFinder.java index f21cf3b52338..98043d2198e8 100644 --- a/scripting/java/org/openoffice/idesupport/JavaFinder.java +++ b/scripting/java/org/openoffice/idesupport/JavaFinder.java @@ -138,7 +138,7 @@ public class JavaFinder implements MethodFinder { } } - return new URLClassLoader(urls.toArray(new URL[0])); + return new URLClassLoader(urls.toArray(new URL[urls.size()])); } private ClassLoader getClassLoader(File basedir) { @@ -232,6 +232,6 @@ public class JavaFinder implements MethodFinder { } } } - return result.toArray(new String[0]); + return result.toArray(new String[result.size()]); } } |