提交 dccd6706 authored 作者: Jacek Ławrynowicz's avatar Jacek Ławrynowicz

performance - redundant array creation for vararg calls

上级 6e0c5af2
......@@ -98,12 +98,10 @@ public class FilePathDisk extends FilePath {
if (ok) {
return;
}
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2,
new String[]{name, newName.name});
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName.name);
}
if (newFile.exists()) {
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2,
new String[] { name, newName + " (exists)" });
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName + " (exists)");
}
for (int i = 0; i < SysProperties.MAX_FILE_RETRY; i++) {
IOUtils.trace("rename", name + " >" + newName, null);
......@@ -113,8 +111,7 @@ public class FilePathDisk extends FilePath {
}
wait(i);
}
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2,
new String[]{name, newName.name});
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName.name);
}
private static void wait(int i) {
......
......@@ -53,8 +53,7 @@ public class FilePathMem extends FilePath {
synchronized (MEMORY_FILES) {
if (!atomicReplace && !newName.name.equals(name) &&
MEMORY_FILES.containsKey(newName.name)) {
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2,
new String[] { name, newName + " (exists)" });
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName + " (exists)");
}
FileMemData f = getMemoryFile();
f.setName(newName.name);
......
......@@ -56,8 +56,7 @@ public class FilePathNioMem extends FilePath {
synchronized (MEMORY_FILES) {
if (!atomicReplace && !name.equals(newName.name) &&
MEMORY_FILES.containsKey(newName.name)) {
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2,
new String[] { name, newName + " (exists)" });
throw DbException.get(ErrorCode.FILE_RENAME_FAILED_2, name, newName + " (exists)");
}
FileNioMemData f = getMemoryFile();
f.setName(newName.name);
......
......@@ -655,7 +655,7 @@ public class Server extends Tool implements Runnable, ShutdownHandler {
if (supported) {
// Desktop.getDesktop();
Object desktop = desktopClass.getMethod("getDesktop").
invoke(null, new Object[0]);
invoke(null);
// desktop.browse(uri);
desktopClass.getMethod("browse", URI.class).
invoke(desktop, uri);
......
......@@ -476,7 +476,7 @@ public class SourceCompiler {
Object configuration = Utils.newInstance(
"org.codehaus.groovy.control.CompilerConfiguration");
Utils.callMethod(configuration,
"addCompilationCustomizers", new Object[] { importCustomizerArray });
"addCompilationCustomizers", importCustomizerArray);
ClassLoader parent = GroovyCompiler.class.getClassLoader();
loader = Utils.newInstance(
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论