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>
This commit is contained in:
rbuj
2014-09-10 12:39:29 +02:00
committed by Noel Grandin
parent 2844128a94
commit de1db03480
2 changed files with 3 additions and 3 deletions

View File

@ -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();

View File

@ -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()]);
}
}