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

cleanup - redundant new for constant array creation

上级 0764b47f
......@@ -1136,7 +1136,7 @@ public class Parser {
}
command.setQueryAlias(readFromAlias(null, Collections.singletonList("ON")));
String[] querySQLOutput = new String[]{null};
String[] querySQLOutput = {null};
List<Column> columnTemplateList = TableView.createQueryColumnTemplateList(null, command.getQuery(),
querySQLOutput);
TableView temporarySourceTableView = createCTEView(
......@@ -5252,7 +5252,7 @@ public class Parser {
recursiveTable = TableView.createShadowTableForRecursiveTableExpression(
isPersistent, session, cteViewName, schema, columns, database);
List<Column> columnTemplateList;
String[] querySQLOutput = new String[]{null};
String[] querySQLOutput = {null};
try {
read("AS");
read("(");
......
......@@ -280,7 +280,7 @@ public class TransactionStore {
void log(Transaction t, long logId, int mapId,
Object key, Object oldValue) {
Long undoKey = getOperationId(t.getId(), logId);
Object[] log = new Object[] { mapId, key, oldValue };
Object[] log = { mapId, key, oldValue };
rwLock.writeLock().lock();
try {
if (logId == 0) {
......
......@@ -217,9 +217,9 @@ public class LobStorageMap implements LobStorageInterface {
long lobId = generateLobId();
long length = streamStore.length(streamStoreId);
int tableId = LobStorageFrontend.TABLE_TEMP;
Object[] value = new Object[] { streamStoreId, tableId, length, 0 };
Object[] value = { streamStoreId, tableId, length, 0 };
lobMap.put(lobId, value);
Object[] key = new Object[] { streamStoreId, lobId };
Object[] key = { streamStoreId, lobId };
refMap.put(key, Boolean.TRUE);
ValueLobDb lob = ValueLobDb.create(
type, database, tableId, lobId, null, length);
......@@ -259,7 +259,7 @@ public class LobStorageMap implements LobStorageInterface {
long lobId = generateLobId();
value[1] = tableId;
lobMap.put(lobId, value);
Object[] key = new Object[] { streamStoreId, lobId };
Object[] key = { streamStoreId, lobId };
refMap.put(key, Boolean.TRUE);
ValueLobDb lob = ValueLobDb.create(
type, database, tableId, lobId, null, length);
......@@ -332,7 +332,7 @@ public class LobStorageMap implements LobStorageInterface {
return;
}
byte[] streamStoreId = (byte[]) value[0];
Object[] key = new Object[] {streamStoreId, lobId };
Object[] key = {streamStoreId, lobId };
refMap.remove(key);
// check if there are more entries for this streamStoreId
key = new Object[] {streamStoreId, 0L };
......
......@@ -732,7 +732,7 @@ public class TableView extends Table {
schema, Arrays.asList(columnTemplates), db);
List<Column> columnTemplateList;
String[] querySQLOutput = new String[]{null};
String[] querySQLOutput = {null};
ArrayList<String> columnNames = new ArrayList<>();
for (Column columnTemplate: columnTemplates) {
columnNames.add(columnTemplate.getName());
......
......@@ -459,7 +459,7 @@ public class SourceCompiler {
Object importCustomizer = Utils.newInstance(
"org.codehaus.groovy.control.customizers.ImportCustomizer");
// Call the method ImportCustomizer.addImports(String[])
String[] importsArray = new String[] {
String[] importsArray = {
"java.sql.Connection",
"java.sql.Types",
"java.sql.ResultSet",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论