mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
Collection.toArray: use empty array instead of presized one
This commit is contained in:
@@ -20,7 +20,9 @@ import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarInputStream;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
@@ -85,7 +87,7 @@ public class CommandLineWrapper {
|
||||
}
|
||||
else {
|
||||
List list = splitBySpaces(programParameters);
|
||||
mainArgs = (String[])list.toArray(new String[list.size()]);
|
||||
mainArgs = (String[])list.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
@@ -173,7 +175,7 @@ public class CommandLineWrapper {
|
||||
String[] mainArgs;
|
||||
if (args.length > startArgsIdx && "@app_params".equals(args[startArgsIdx - 1])) {
|
||||
List lines = readLinesAndDeleteFile(new File(args[startArgsIdx]));
|
||||
mainArgs = (String[])lines.toArray(new String[lines.size()]);
|
||||
mainArgs = (String[])lines.toArray(new String[0]);
|
||||
startArgsIdx += 2;
|
||||
}
|
||||
else {
|
||||
@@ -182,7 +184,7 @@ public class CommandLineWrapper {
|
||||
}
|
||||
|
||||
String mainClassName = args[startArgsIdx - 1];
|
||||
ClassLoader loader = new URLClassLoader((URL[])classpathUrls.toArray(new URL[classpathUrls.size()]), null);
|
||||
ClassLoader loader = new URLClassLoader((URL[])classpathUrls.toArray(new URL[0]), null);
|
||||
String systemLoaderName = System.getProperty("java.system.class.loader");
|
||||
if (systemLoaderName != null) {
|
||||
try {
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public class ForkedDebuggerHelper {
|
||||
if (arg.startsWith(DEBUG_SOCKET)) {
|
||||
final List list = new ArrayList(Arrays.asList(args));
|
||||
list.remove(arg);
|
||||
args = (String[])list.toArray(new String[list.size()]);
|
||||
args = (String[])list.toArray(new String[0]);
|
||||
myDebugPort = Integer.parseInt(arg.substring(DEBUG_SOCKET.length()));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user