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