Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
639d0551
提交
639d0551
authored
1月 08, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use ArrayList.toArray(new T[0]) instead of ArrayList.toArray(new T[size])
上级
31a0fa4c
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
54 行增加
和
102 行删除
+54
-102
Bnf.java
h2/src/main/org/h2/bnf/Bnf.java
+1
-1
DbContents.java
h2/src/main/org/h2/bnf/context/DbContents.java
+1
-3
DbSchema.java
h2/src/main/org/h2/bnf/context/DbSchema.java
+2
-4
DbTableOrView.java
h2/src/main/org/h2/bnf/context/DbTableOrView.java
+1
-2
Parser.java
h2/src/main/org/h2/command/Parser.java
+13
-19
Select.java
h2/src/main/org/h2/command/dml/Select.java
+5
-8
SelectUnion.java
h2/src/main/org/h2/command/dml/SelectUnion.java
+2
-3
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-3
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+1
-2
Session.java
h2/src/main/org/h2/engine/Session.java
+1
-3
Function.java
h2/src/main/org/h2/expression/Function.java
+2
-4
TableFunction.java
h2/src/main/org/h2/expression/TableFunction.java
+1
-2
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+1
-2
FullTextLucene.java
h2/src/main/org/h2/fulltext/FullTextLucene.java
+1
-2
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+1
-2
JdbcXAConnection.java
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
+1
-2
SortOrder.java
h2/src/main/org/h2/result/SortOrder.java
+1
-1
WebServlet.java
h2/src/main/org/h2/server/web/WebServlet.java
+1
-2
FilePathSplit.java
h2/src/main/org/h2/store/fs/FilePathSplit.java
+1
-2
Plan.java
h2/src/main/org/h2/table/Plan.java
+2
-4
TableBase.java
h2/src/main/org/h2/table/TableBase.java
+1
-2
TableLink.java
h2/src/main/org/h2/table/TableLink.java
+2
-4
TableView.java
h2/src/main/org/h2/table/TableView.java
+1
-2
Csv.java
h2/src/main/org/h2/tools/Csv.java
+1
-2
MultiDimension.java
h2/src/main/org/h2/tools/MultiDimension.java
+1
-3
JdbcUtils.java
h2/src/main/org/h2/util/JdbcUtils.java
+1
-2
Profiler.java
h2/src/main/org/h2/util/Profiler.java
+1
-1
StringUtils.java
h2/src/main/org/h2/util/StringUtils.java
+1
-3
ValueArray.java
h2/src/main/org/h2/value/ValueArray.java
+1
-3
TaskProcess.java
h2/src/test/org/h2/test/db/TaskProcess.java
+1
-2
Expression.java
h2/src/test/org/h2/test/synth/sql/Expression.java
+1
-3
Parser.java
h2/src/test/org/h2/test/trace/Parser.java
+1
-2
Statement.java
h2/src/test/org/h2/test/trace/Statement.java
+1
-2
没有找到文件。
h2/src/main/org/h2/bnf/Bnf.java
浏览文件 @
639d0551
...
...
@@ -283,7 +283,7 @@ public class Bnf {
}
list
.
add
(
s
);
}
return
list
.
toArray
(
new
String
[
list
.
size
()
]);
return
list
.
toArray
(
new
String
[
0
]);
}
/**
...
...
h2/src/main/org/h2/bnf/context/DbContents.java
浏览文件 @
639d0551
...
...
@@ -234,9 +234,7 @@ public class DbContents {
schemaList
.
add
(
schema
);
}
rs
.
close
();
String
[]
list
=
new
String
[
schemaList
.
size
()];
schemaList
.
toArray
(
list
);
return
list
;
return
schemaList
.
toArray
(
new
String
[
0
]);
}
private
String
getDefaultSchemaName
(
DatabaseMetaData
meta
)
{
...
...
h2/src/main/org/h2/bnf/context/DbSchema.java
浏览文件 @
639d0551
...
...
@@ -117,8 +117,7 @@ public class DbSchema {
list
.
add
(
table
);
}
rs
.
close
();
tables
=
new
DbTableOrView
[
list
.
size
()];
list
.
toArray
(
tables
);
tables
=
list
.
toArray
(
new
DbTableOrView
[
0
]);
if
(
tables
.
length
<
SysProperties
.
CONSOLE_MAX_TABLES_LIST_COLUMNS
)
{
for
(
DbTableOrView
tab
:
tables
)
{
try
{
...
...
@@ -146,8 +145,7 @@ public class DbSchema {
list
.
add
(
new
DbProcedure
(
this
,
rs
));
}
rs
.
close
();
procedures
=
new
DbProcedure
[
list
.
size
()];
list
.
toArray
(
procedures
);
procedures
=
list
.
toArray
(
new
DbProcedure
[
0
]);
if
(
procedures
.
length
<
SysProperties
.
CONSOLE_MAX_PROCEDURES_LIST_COLUMNS
)
{
for
(
DbProcedure
procedure
:
procedures
)
{
procedure
.
readParameters
(
meta
);
...
...
h2/src/main/org/h2/bnf/context/DbTableOrView.java
浏览文件 @
639d0551
...
...
@@ -98,8 +98,7 @@ public class DbTableOrView {
list
.
add
(
column
);
}
rs
.
close
();
columns
=
new
DbColumn
[
list
.
size
()];
list
.
toArray
(
columns
);
columns
=
list
.
toArray
(
new
DbColumn
[
0
]);
}
}
h2/src/main/org/h2/command/Parser.java
浏览文件 @
639d0551
...
...
@@ -913,7 +913,7 @@ public class Parser {
}
}
while
(
readIf
(
","
));
read
(
")"
);
return
columns
.
toArray
(
new
IndexColumn
[
columns
.
size
()
]);
return
columns
.
toArray
(
new
IndexColumn
[
0
]);
}
private
String
[]
parseColumnList
()
{
...
...
@@ -922,7 +922,7 @@ public class Parser {
String
columnName
=
readColumnIdentifier
();
columns
.
add
(
columnName
);
}
while
(
readIfMore
());
return
columns
.
toArray
(
new
String
[
columns
.
size
()
]);
return
columns
.
toArray
(
new
String
[
0
]);
}
private
Column
[]
parseColumnList
(
Table
table
)
{
...
...
@@ -938,7 +938,7 @@ public class Parser {
columns
.
add
(
column
);
}
while
(
readIfMore
());
}
return
columns
.
toArray
(
new
Column
[
columns
.
size
()
]);
return
columns
.
toArray
(
new
Column
[
0
]);
}
private
Column
parseColumn
(
Table
table
)
{
...
...
@@ -1117,7 +1117,7 @@ public class Parser {
}
}
while
(
readIfMore
());
}
command
.
addRow
(
values
.
toArray
(
new
Expression
[
values
.
size
()
]));
command
.
addRow
(
values
.
toArray
(
new
Expression
[
0
]));
}
while
(
readIf
(
","
));
}
else
{
command
.
setQuery
(
parseSelect
());
...
...
@@ -1283,7 +1283,7 @@ public class Parser {
}
}
while
(
readIfMore
());
}
command
.
addRow
(
values
.
toArray
(
new
Expression
[
values
.
size
()
]));
command
.
addRow
(
values
.
toArray
(
new
Expression
[
0
]));
// the following condition will allow (..),; and (..);
}
while
(
readIf
(
","
)
&&
readIf
(
"("
));
}
else
if
(
readIf
(
"SET"
))
{
...
...
@@ -1303,8 +1303,8 @@ public class Parser {
}
values
.
add
(
expression
);
}
while
(
readIf
(
","
));
command
.
setColumns
(
columnList
.
toArray
(
new
Column
[
columnList
.
size
()
]));
command
.
addRow
(
values
.
toArray
(
new
Expression
[
values
.
size
()
]));
command
.
setColumns
(
columnList
.
toArray
(
new
Column
[
0
]));
command
.
addRow
(
values
.
toArray
(
new
Expression
[
0
]));
}
else
{
command
.
setQuery
(
parseSelect
());
}
...
...
@@ -1342,7 +1342,7 @@ public class Parser {
}
}
while
(
readIfMore
());
}
command
.
addRow
(
values
.
toArray
(
new
Expression
[
values
.
size
()
]));
command
.
addRow
(
values
.
toArray
(
new
Expression
[
0
]));
}
while
(
readIf
(
","
));
}
else
{
command
.
setQuery
(
parseSelect
());
...
...
@@ -2712,8 +2712,7 @@ public class Parser {
}
argList
.
add
(
readExpression
());
}
args
=
new
Expression
[
numArgs
];
argList
.
toArray
(
args
);
args
=
argList
.
toArray
(
new
Expression
[
0
]);
JavaFunction
func
=
new
JavaFunction
(
functionAlias
,
args
);
return
func
;
}
...
...
@@ -2724,8 +2723,7 @@ public class Parser {
params
.
add
(
readExpression
());
}
while
(
readIf
(
","
));
read
(
")"
);
Expression
[]
list
=
new
Expression
[
params
.
size
()];
params
.
toArray
(
list
);
Expression
[]
list
=
params
.
toArray
(
new
Expression
[
0
]);
JavaAggregate
agg
=
new
JavaAggregate
(
aggregate
,
list
,
currentSelect
);
currentSelect
.
setGroupQuery
();
return
agg
;
...
...
@@ -3227,9 +3225,7 @@ public class Parser {
break
;
}
}
Expression
[]
array
=
new
Expression
[
list
.
size
()];
list
.
toArray
(
array
);
r
=
new
ExpressionList
(
array
);
r
=
new
ExpressionList
(
list
.
toArray
(
new
Expression
[
0
]));
}
else
{
read
(
")"
);
}
...
...
@@ -4533,7 +4529,7 @@ public class Parser {
}
read
(
")"
);
original
+=
')'
;
enumerators
=
enumeratorList
.
toArray
(
new
String
[
enumeratorList
.
size
()
]);
enumerators
=
enumeratorList
.
toArray
(
new
String
[
0
]);
}
try
{
ValueEnum
.
check
(
enumerators
);
...
...
@@ -5756,9 +5752,7 @@ public class Parser {
while
(
readIf
(
","
))
{
list
.
add
(
readAliasIdentifier
());
}
String
[]
schemaNames
=
new
String
[
list
.
size
()];
list
.
toArray
(
schemaNames
);
command
.
setStringArray
(
schemaNames
);
command
.
setStringArray
(
list
.
toArray
(
new
String
[
0
]));
return
command
;
}
else
if
(
readIf
(
"JAVA_OBJECT_SERIALIZER"
))
{
readIfEqualOrTo
();
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
639d0551
...
...
@@ -387,7 +387,7 @@ public class Select extends Query {
}
sortColumns
.
add
(
exprCol
.
getColumn
());
}
Column
[]
sortCols
=
sortColumns
.
toArray
(
new
Column
[
sortColumns
.
size
()
]);
Column
[]
sortCols
=
sortColumns
.
toArray
(
new
Column
[
0
]);
if
(
sortCols
.
length
==
0
)
{
// sort just on constants - can use scan index
return
topTableFilter
.
getTable
().
getScanIndex
(
session
);
...
...
@@ -930,8 +930,7 @@ public class Select extends Query {
isGroupSortedQuery
=
true
;
}
}
expressionArray
=
new
Expression
[
expressions
.
size
()];
expressions
.
toArray
(
expressionArray
);
expressionArray
=
expressions
.
toArray
(
new
Expression
[
0
]);
isPrepared
=
true
;
}
...
...
@@ -947,7 +946,7 @@ public class Select extends Query {
list
.
add
(
f
);
f
=
f
.
getJoin
();
}
while
(
f
!=
null
);
TableFilter
[]
fs
=
list
.
toArray
(
new
TableFilter
[
list
.
size
()
]);
TableFilter
[]
fs
=
list
.
toArray
(
new
TableFilter
[
0
]);
// prepare join batch
JoinBatch
jb
=
null
;
for
(
int
i
=
fs
.
length
-
1
;
i
>=
0
;
i
--)
{
...
...
@@ -982,8 +981,7 @@ public class Select extends Query {
}
private
double
preparePlan
(
boolean
parse
)
{
TableFilter
[]
topArray
=
topFilters
.
toArray
(
new
TableFilter
[
topFilters
.
size
()]);
TableFilter
[]
topArray
=
topFilters
.
toArray
(
new
TableFilter
[
0
]);
for
(
TableFilter
t
:
topArray
)
{
t
.
setFullCondition
(
condition
);
}
...
...
@@ -1058,8 +1056,7 @@ public class Select extends Query {
// can not use the field sqlStatement because the parameter
// indexes may be incorrect: ? may be in fact ?2 for a subquery
// but indexes may be set manually as well
Expression
[]
exprList
=
expressions
.
toArray
(
new
Expression
[
expressions
.
size
()]);
Expression
[]
exprList
=
expressions
.
toArray
(
new
Expression
[
0
]);
StatementBuilder
buff
=
new
StatementBuilder
();
for
(
TableFilter
f
:
topFilters
)
{
Table
t
=
f
.
getTable
();
...
...
h2/src/main/org/h2/command/dml/SelectUnion.java
浏览文件 @
639d0551
...
...
@@ -348,8 +348,7 @@ public class SelectUnion extends Query {
sort
=
prepareOrder
(
orderList
,
expressions
.
size
());
orderList
=
null
;
}
expressionArray
=
new
Expression
[
expressions
.
size
()];
expressions
.
toArray
(
expressionArray
);
expressionArray
=
expressions
.
toArray
(
new
Expression
[
0
]);
}
@Override
...
...
@@ -435,7 +434,7 @@ public class SelectUnion extends Query {
DbException
.
throwInternalError
(
"type="
+
unionType
);
}
buff
.
append
(
'('
).
append
(
right
.
getPlanSQL
()).
append
(
')'
);
Expression
[]
exprList
=
expressions
.
toArray
(
new
Expression
[
expressions
.
size
()
]);
Expression
[]
exprList
=
expressions
.
toArray
(
new
Expression
[
0
]);
if
(
sort
!=
null
)
{
buff
.
append
(
"\nORDER BY "
).
append
(
sort
.
getSQL
(
exprList
,
exprList
.
length
));
}
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
639d0551
...
...
@@ -1677,9 +1677,7 @@ public class Database implements DataHandler {
if
(
includingSystemSession
&&
lob
!=
null
)
{
list
.
add
(
lob
);
}
Session
[]
array
=
new
Session
[
list
.
size
()];
list
.
toArray
(
array
);
return
array
;
return
list
.
toArray
(
new
Session
[
0
]);
}
/**
...
...
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
639d0551
...
...
@@ -168,8 +168,7 @@ public class FunctionAlias extends SchemaObjectBase {
ErrorCode
.
PUBLIC_STATIC_JAVA_METHOD_NOT_FOUND_1
,
methodName
+
" ("
+
className
+
")"
);
}
javaMethods
=
new
JavaMethod
[
list
.
size
()];
list
.
toArray
(
javaMethods
);
javaMethods
=
list
.
toArray
(
new
JavaMethod
[
0
]);
// Sort elements. Methods with a variable number of arguments must be at
// the end. Reason: there could be one method without parameters and one
// with a variable number. The one without parameters needs to be used
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
639d0551
...
...
@@ -1440,9 +1440,7 @@ public class Session extends SessionWithState {
break
;
}
}
Table
[]
list
=
new
Table
[
copy
.
size
()];
copy
.
toArray
(
list
);
return
list
;
return
copy
.
toArray
(
new
Table
[
0
]);
}
/**
...
...
h2/src/main/org/h2/expression/Function.java
浏览文件 @
639d0551
...
...
@@ -2308,10 +2308,8 @@ public class Function extends Expression implements FunctionCall {
*/
public
void
doneWithParameters
()
{
if
(
info
.
parameterCount
==
VAR_ARGS
)
{
int
len
=
varArgs
.
size
();
checkParameterCount
(
len
);
args
=
new
Expression
[
len
];
varArgs
.
toArray
(
args
);
checkParameterCount
(
varArgs
.
size
());
args
=
varArgs
.
toArray
(
new
Expression
[
0
]);
varArgs
=
null
;
}
else
{
int
len
=
args
.
length
;
...
...
h2/src/main/org/h2/expression/TableFunction.java
浏览文件 @
639d0551
...
...
@@ -73,8 +73,7 @@ public class TableFunction extends Function {
}
public
void
setColumns
(
ArrayList
<
Column
>
columns
)
{
this
.
columnList
=
new
Column
[
columns
.
size
()];
columns
.
toArray
(
columnList
);
this
.
columnList
=
columns
.
toArray
(
new
Column
[
0
]);
}
private
ValueResultSet
getTable
(
Session
session
,
Expression
[]
argList
,
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
639d0551
...
...
@@ -905,8 +905,7 @@ public class FullText {
index
=
new
IndexInfo
();
index
.
schema
=
schemaName
;
index
.
table
=
tableName
;
index
.
columns
=
new
String
[
columnList
.
size
()];
columnList
.
toArray
(
index
.
columns
);
index
.
columns
=
columnList
.
toArray
(
new
String
[
0
]);
rs
=
meta
.
getColumns
(
null
,
StringUtils
.
escapeMetaDataPattern
(
schemaName
),
StringUtils
.
escapeMetaDataPattern
(
tableName
),
...
...
h2/src/main/org/h2/fulltext/FullTextLucene.java
浏览文件 @
639d0551
...
...
@@ -497,8 +497,7 @@ public class FullTextLucene extends FullText {
columnList
.
add
(
rs
.
getString
(
"COLUMN_NAME"
));
}
columnTypes
=
new
int
[
columnList
.
size
()];
columns
=
new
String
[
columnList
.
size
()];
columnList
.
toArray
(
columns
);
columns
=
columnList
.
toArray
(
new
String
[
0
]);
rs
=
meta
.
getColumns
(
null
,
StringUtils
.
escapeMetaDataPattern
(
schemaName
),
StringUtils
.
escapeMetaDataPattern
(
tableName
),
...
...
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
639d0551
...
...
@@ -359,8 +359,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
i
++;
}
}
columns
=
new
Column
[
columnList
.
size
()];
columnList
.
toArray
(
columns
);
columns
=
columnList
.
toArray
(
new
Column
[
0
]);
// reconstruct the index columns from the masks
this
.
indexColumns
=
new
IndexColumn
[
indexColumnCount
];
...
...
h2/src/main/org/h2/jdbcx/JdbcXAConnection.java
浏览文件 @
639d0551
...
...
@@ -201,8 +201,7 @@ public class JdbcXAConnection extends TraceObject implements XAConnection,
list
.
add
(
xid
);
}
rs
.
close
();
Xid
[]
result
=
new
Xid
[
list
.
size
()];
list
.
toArray
(
result
);
Xid
[]
result
=
list
.
toArray
(
new
Xid
[
0
]);
if
(
list
.
size
()
>
0
)
{
prepared
=
true
;
}
...
...
h2/src/main/org/h2/result/SortOrder.java
浏览文件 @
639d0551
...
...
@@ -209,7 +209,7 @@ public class SortOrder implements Comparator<Value[]> {
rows
.
set
(
0
,
Collections
.
min
(
rows
,
this
));
return
;
}
Value
[][]
arr
=
rows
.
toArray
(
new
Value
[
rowsSize
][]);
Value
[][]
arr
=
rows
.
toArray
(
new
Value
[
0
][]);
Utils
.
sortTopN
(
arr
,
offset
,
limit
,
this
);
for
(
int
i
=
0
,
end
=
Math
.
min
(
offset
+
limit
,
rowsSize
);
i
<
end
;
i
++)
{
rows
.
set
(
i
,
arr
[
i
]);
...
...
h2/src/main/org/h2/server/web/WebServlet.java
浏览文件 @
639d0551
...
...
@@ -46,8 +46,7 @@ public class WebServlet extends HttpServlet {
list
.
add
(
value
);
}
}
String
[]
args
=
new
String
[
list
.
size
()];
list
.
toArray
(
args
);
String
[]
args
=
list
.
toArray
(
new
String
[
0
]);
server
=
new
WebServer
();
server
.
setAllowChunked
(
false
);
server
.
init
(
args
);
...
...
h2/src/main/org/h2/store/fs/FilePathSplit.java
浏览文件 @
639d0551
...
...
@@ -131,8 +131,7 @@ public class FilePathSplit extends FilePathWrapper {
break
;
}
}
FileChannel
[]
array
=
new
FileChannel
[
list
.
size
()];
list
.
toArray
(
array
);
FileChannel
[]
array
=
list
.
toArray
(
new
FileChannel
[
0
]);
long
maxLength
=
array
[
0
].
size
();
long
length
=
maxLength
;
if
(
array
.
length
==
1
)
{
...
...
h2/src/main/org/h2/table/Plan.java
浏览文件 @
639d0551
...
...
@@ -54,10 +54,8 @@ public class Plan {
}
});
}
allConditions
=
new
Expression
[
allCond
.
size
()];
allCond
.
toArray
(
allConditions
);
allFilters
=
new
TableFilter
[
all
.
size
()];
all
.
toArray
(
allFilters
);
allConditions
=
allCond
.
toArray
(
new
Expression
[
0
]);
allFilters
=
all
.
toArray
(
new
TableFilter
[
0
]);
}
/**
...
...
h2/src/main/org/h2/table/TableBase.java
浏览文件 @
639d0551
...
...
@@ -40,8 +40,7 @@ public abstract class TableBase extends Table {
this
.
tableEngineParams
=
data
.
tableEngineParams
;
}
setTemporary
(
data
.
temporary
);
Column
[]
cols
=
new
Column
[
data
.
columns
.
size
()];
data
.
columns
.
toArray
(
cols
);
Column
[]
cols
=
data
.
columns
.
toArray
(
new
Column
[
0
]);
setColumns
(
cols
);
}
...
...
h2/src/main/org/h2/table/TableLink.java
浏览文件 @
639d0551
...
...
@@ -195,8 +195,7 @@ public class TableLink extends Table {
throw
DbException
.
get
(
ErrorCode
.
TABLE_OR_VIEW_NOT_FOUND_1
,
e
,
originalTable
+
"("
+
e
.
toString
()
+
")"
);
}
Column
[]
cols
=
new
Column
[
columnList
.
size
()];
columnList
.
toArray
(
cols
);
Column
[]
cols
=
columnList
.
toArray
(
new
Column
[
0
]);
setColumns
(
cols
);
int
id
=
getId
();
linkedIndex
=
new
LinkedIndex
(
this
,
id
,
IndexColumn
.
wrap
(
cols
),
...
...
@@ -344,8 +343,7 @@ public class TableLink extends Table {
"recognized columns of {1} total columns."
,
firstNull
,
list
.
size
());
list
=
list
.
subList
(
0
,
firstNull
);
}
Column
[]
cols
=
new
Column
[
list
.
size
()];
list
.
toArray
(
cols
);
Column
[]
cols
=
list
.
toArray
(
new
Column
[
0
]);
Index
index
=
new
LinkedIndex
(
this
,
0
,
IndexColumn
.
wrap
(
cols
),
indexType
);
indexes
.
add
(
index
);
}
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
639d0551
...
...
@@ -198,8 +198,7 @@ public class TableView extends Table {
}
list
.
add
(
col
);
}
cols
=
new
Column
[
list
.
size
()];
list
.
toArray
(
cols
);
cols
=
list
.
toArray
(
new
Column
[
0
]);
createException
=
null
;
viewQuery
=
query
;
}
catch
(
DbException
e
)
{
...
...
h2/src/main/org/h2/tools/Csv.java
浏览文件 @
639d0551
...
...
@@ -361,8 +361,7 @@ public class Csv implements SimpleRowSource {
}
}
}
columnNames
=
new
String
[
list
.
size
()];
list
.
toArray
(
columnNames
);
columnNames
=
list
.
toArray
(
new
String
[
0
]);
}
private
static
boolean
isSimpleColumnName
(
String
columnName
)
{
...
...
h2/src/main/org/h2/tools/MultiDimension.java
浏览文件 @
639d0551
...
...
@@ -222,9 +222,7 @@ public class MultiDimension implements Comparator<long[]> {
ArrayList
<
long
[]>
list
=
New
.
arrayList
();
addMortonRanges
(
list
,
min
,
max
,
len
,
0
);
combineEntries
(
list
,
total
);
long
[][]
ranges
=
new
long
[
list
.
size
()][
2
];
list
.
toArray
(
ranges
);
return
ranges
;
return
list
.
toArray
(
new
long
[
0
][]);
}
private
static
int
getSize
(
int
[]
min
,
int
[]
max
,
int
len
)
{
...
...
h2/src/main/org/h2/util/JdbcUtils.java
浏览文件 @
639d0551
...
...
@@ -156,8 +156,7 @@ public class JdbcUtils {
classNames
.
add
(
p
);
}
}
allowedClassNamePrefixes
=
new
String
[
prefixes
.
size
()];
prefixes
.
toArray
(
allowedClassNamePrefixes
);
allowedClassNamePrefixes
=
prefixes
.
toArray
(
new
String
[
0
]);
allowAllClasses
=
allowAll
;
allowedClassNames
=
classNames
;
}
...
...
h2/src/main/org/h2/util/Profiler.java
浏览文件 @
639d0551
...
...
@@ -257,7 +257,7 @@ public class Profiler implements Runnable {
stack
.
add
(
line
);
}
if
(
stack
.
size
()
>
0
)
{
String
[]
s
=
stack
.
toArray
(
new
String
[
stack
.
size
()
]);
String
[]
s
=
stack
.
toArray
(
new
String
[
0
]);
list
.
add
(
s
);
}
}
...
...
h2/src/main/org/h2/util/StringUtils.java
浏览文件 @
639d0551
...
...
@@ -492,9 +492,7 @@ public class StringUtils {
}
String
e
=
buff
.
toString
();
list
.
add
(
trim
?
e
.
trim
()
:
e
);
String
[]
array
=
new
String
[
list
.
size
()];
list
.
toArray
(
array
);
return
array
;
return
list
.
toArray
(
new
String
[
0
]);
}
/**
...
...
h2/src/main/org/h2/value/ValueArray.java
浏览文件 @
639d0551
...
...
@@ -212,9 +212,7 @@ public class ValueArray extends Value {
}
list
.
add
(
v
);
}
Value
[]
array
=
new
Value
[
list
.
size
()];
list
.
toArray
(
array
);
return
get
(
array
);
return
get
(
list
.
toArray
(
new
Value
[
0
]));
}
}
h2/src/test/org/h2/test/db/TaskProcess.java
浏览文件 @
639d0551
...
...
@@ -57,8 +57,7 @@ public class TaskProcess {
if
(
args
!=
null
&&
args
.
length
>
0
)
{
list
.
addAll
(
Arrays
.
asList
(
args
));
}
String
[]
procDef
=
new
String
[
list
.
size
()];
list
.
toArray
(
procDef
);
String
[]
procDef
=
list
.
toArray
(
new
String
[
0
]);
process
=
Runtime
.
getRuntime
().
exec
(
procDef
);
copyInThread
(
process
.
getErrorStream
(),
System
.
err
);
reader
=
new
BufferedReader
(
new
InputStreamReader
(
process
.
getInputStream
()));
...
...
h2/src/test/org/h2/test/synth/sql/Expression.java
浏览文件 @
639d0551
...
...
@@ -47,9 +47,7 @@ public class Expression {
exp
.
add
(
sql
);
sql
=
""
;
}
String
[]
list
=
new
String
[
exp
.
size
()];
exp
.
toArray
(
list
);
return
list
;
return
exp
.
toArray
(
new
String
[
0
]);
}
/**
...
...
h2/src/test/org/h2/test/trace/Parser.java
浏览文件 @
639d0551
...
...
@@ -214,8 +214,7 @@ class Parser {
values
.
add
(
parseValue
().
getValue
());
}
while
(
readIf
(
","
));
read
(
"}"
);
String
[]
list
=
new
String
[
values
.
size
()];
values
.
toArray
(
list
);
String
[]
list
=
values
.
toArray
(
new
String
[
0
]);
return
new
Arg
(
String
[].
class
,
list
);
}
else
if
(
readIf
(
"BigDecimal"
))
{
read
(
"("
);
...
...
h2/src/test/org/h2/test/trace/Statement.java
浏览文件 @
639d0551
...
...
@@ -162,7 +162,6 @@ class Statement {
}
public
void
setArgs
(
ArrayList
<
Arg
>
list
)
{
args
=
new
Arg
[
list
.
size
()];
list
.
toArray
(
args
);
args
=
list
.
toArray
(
new
Arg
[
0
]);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论