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

cleanup - redundant new for constant array creation

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