Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
fdcd54e3
Unverified
提交
fdcd54e3
authored
5月 20, 2018
作者:
Noel Grandin
提交者:
GitHub
5月 20, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1146 from grandinj/1091_new
1091 get rid of the "New" class
上级
ed6735a0
0c90e9d4
隐藏空白字符变更
内嵌
并排
正在显示
36 个修改的文件
包含
60 行增加
和
63 行删除
+60
-63
Parser.java
h2/src/main/org/h2/command/Parser.java
+7
-5
AlterTableAlterColumn.java
h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java
+1
-1
CommandWithColumns.java
h2/src/main/org/h2/command/ddl/CommandWithColumns.java
+1
-1
DropDatabase.java
h2/src/main/org/h2/command/ddl/DropDatabase.java
+1
-1
PrepareProcedure.java
h2/src/main/org/h2/command/ddl/PrepareProcedure.java
+1
-2
Query.java
h2/src/main/org/h2/command/dml/Query.java
+1
-1
Select.java
h2/src/main/org/h2/command/dml/Select.java
+2
-2
SelectUnion.java
h2/src/main/org/h2/command/dml/SelectUnion.java
+2
-3
Database.java
h2/src/main/org/h2/engine/Database.java
+1
-1
FunctionAlias.java
h2/src/main/org/h2/engine/FunctionAlias.java
+1
-1
Session.java
h2/src/main/org/h2/engine/Session.java
+2
-2
ViewIndex.java
h2/src/main/org/h2/index/ViewIndex.java
+1
-2
MVSecondaryIndex.java
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
+1
-2
MVTable.java
h2/src/main/org/h2/mvstore/db/MVTable.java
+1
-1
MVRTreeMap.java
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
+1
-2
SpatialDataType.java
h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java
+4
-4
ResultRemote.java
h2/src/main/org/h2/result/ResultRemote.java
+1
-2
WebServer.java
h2/src/main/org/h2/server/web/WebServer.java
+1
-1
FilePathDisk.java
h2/src/main/org/h2/store/fs/FilePathDisk.java
+1
-0
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+2
-2
Plan.java
h2/src/main/org/h2/table/Plan.java
+2
-3
RegularTable.java
h2/src/main/org/h2/table/RegularTable.java
+3
-3
TableView.java
h2/src/main/org/h2/table/TableView.java
+3
-2
MultiDimension.java
h2/src/main/org/h2/tools/MultiDimension.java
+0
-1
CacheTQ.java
h2/src/main/org/h2/util/CacheTQ.java
+5
-3
TestCsv.java
h2/src/test/org/h2/test/db/TestCsv.java
+1
-1
TestMultiThreadedKernel.java
h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java
+2
-2
SupportedTypes.java
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
+1
-1
TestConcurrent.java
h2/src/test/org/h2/test/store/TestConcurrent.java
+1
-1
TestMVRTree.java
h2/src/test/org/h2/test/store/TestMVRTree.java
+1
-1
TestMVStoreBenchmark.java
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
+3
-3
TestSynth.java
h2/src/test/org/h2/test/synth/sql/TestSynth.java
+0
-1
TestFileLockProcess.java
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
+1
-1
TestPageStore.java
h2/src/test/org/h2/test/unit/TestPageStore.java
+1
-1
ArchiveToolStore.java
h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java
+2
-2
DbInspector.java
h2/src/tools/org/h2/jaqu/DbInspector.java
+1
-1
没有找到文件。
h2/src/main/org/h2/command/Parser.java
浏览文件 @
fdcd54e3
...
...
@@ -1530,7 +1530,7 @@ public class Parser {
private
ArrayList
<
String
>
readDerivedColumnNames
()
{
if
(
readIf
(
"("
))
{
ArrayList
<
String
>
derivedColumnNames
=
Utils
.
newSmallArrayList
();
ArrayList
<
String
>
derivedColumnNames
=
new
ArrayList
<>
();
do
{
derivedColumnNames
.
add
(
readAliasIdentifier
());
}
while
(
readIfMore
(
true
));
...
...
@@ -1950,8 +1950,9 @@ public class Parser {
Query
command
=
null
;
int
paramIndex
=
parameters
.
size
();
command
=
parseSelectUnion
();
ArrayList
<
Parameter
>
params
=
Utils
.
newSmallArrayList
();
for
(
int
i
=
paramIndex
,
size
=
parameters
.
size
();
i
<
size
;
i
++)
{
int
size
=
parameters
.
size
();
ArrayList
<
Parameter
>
params
=
new
ArrayList
<>(
size
);
for
(
int
i
=
paramIndex
;
i
<
size
;
i
++)
{
params
.
add
(
parameters
.
get
(
i
));
}
command
.
setParameterList
(
params
);
...
...
@@ -1962,8 +1963,9 @@ public class Parser {
private
Prepared
parseWithStatementOrQuery
()
{
int
paramIndex
=
parameters
.
size
();
Prepared
command
=
parseWith
();
ArrayList
<
Parameter
>
params
=
Utils
.
newSmallArrayList
();
for
(
int
i
=
paramIndex
,
size
=
parameters
.
size
();
i
<
size
;
i
++)
{
int
size
=
parameters
.
size
();
ArrayList
<
Parameter
>
params
=
new
ArrayList
<>(
size
);
for
(
int
i
=
paramIndex
;
i
<
size
;
i
++)
{
params
.
add
(
parameters
.
get
(
i
));
}
command
.
setParameterList
(
params
);
...
...
h2/src/main/org/h2/command/ddl/AlterTableAlterColumn.java
浏览文件 @
fdcd54e3
...
...
@@ -280,7 +280,7 @@ public class AlterTableAlterColumn extends CommandWithColumns {
String
baseName
=
table
.
getName
();
String
tempName
=
db
.
getTempTableName
(
baseName
,
session
);
Column
[]
columns
=
table
.
getColumns
();
ArrayList
<
Column
>
newColumns
=
new
ArrayList
<>();
ArrayList
<
Column
>
newColumns
=
new
ArrayList
<>(
columns
.
length
);
Table
newTable
=
cloneTableStructure
(
table
,
columns
,
db
,
tempName
,
newColumns
);
if
(
sequences
!=
null
)
{
for
(
Sequence
sequence
:
sequences
)
{
...
...
h2/src/main/org/h2/command/ddl/CommandWithColumns.java
浏览文件 @
fdcd54e3
...
...
@@ -99,7 +99,7 @@ public abstract class CommandWithColumns extends SchemaCommand {
* @return the list of sequences (may be empty)
*/
protected
ArrayList
<
Sequence
>
generateSequences
(
ArrayList
<
Column
>
columns
,
boolean
temporary
)
{
ArrayList
<
Sequence
>
sequences
=
new
ArrayList
<>();
ArrayList
<
Sequence
>
sequences
=
new
ArrayList
<>(
columns
==
null
?
0
:
columns
.
size
()
);
if
(
columns
!=
null
)
{
for
(
Column
c
:
columns
)
{
if
(
c
.
isAutoIncrement
())
{
...
...
h2/src/main/org/h2/command/ddl/DropDatabase.java
浏览文件 @
fdcd54e3
...
...
@@ -54,7 +54,7 @@ public class DropDatabase extends DefineCommand {
boolean
runLoopAgain
;
do
{
ArrayList
<
Table
>
tables
=
db
.
getAllTablesAndViews
(
false
);
ArrayList
<
Table
>
toRemove
=
new
ArrayList
<>();
ArrayList
<
Table
>
toRemove
=
new
ArrayList
<>(
tables
.
size
()
);
for
(
Table
t
:
tables
)
{
if
(
t
.
getName
()
!=
null
&&
TableType
.
VIEW
==
t
.
getTableType
())
{
...
...
h2/src/main/org/h2/command/ddl/PrepareProcedure.java
浏览文件 @
fdcd54e3
...
...
@@ -12,7 +12,6 @@ import org.h2.command.Prepared;
import
org.h2.engine.Procedure
;
import
org.h2.engine.Session
;
import
org.h2.expression.Parameter
;
import
org.h2.util.Utils
;
/**
* This class represents the statement
...
...
@@ -52,7 +51,7 @@ public class PrepareProcedure extends DefineCommand {
@Override
public
ArrayList
<
Parameter
>
getParameters
()
{
return
Utils
.
newSmallArrayList
(
);
return
new
ArrayList
<>(
0
);
}
@Override
...
...
h2/src/main/org/h2/command/dml/Query.java
浏览文件 @
fdcd54e3
...
...
@@ -317,7 +317,7 @@ public abstract class Query extends Prepared {
public
final
Value
[]
getParameterValues
()
{
ArrayList
<
Parameter
>
list
=
getParameters
();
if
(
list
==
null
)
{
list
=
Utils
.
newSmallArrayList
()
;
return
new
Value
[
0
]
;
}
int
size
=
list
.
size
();
Value
[]
params
=
new
Value
[
size
];
...
...
h2/src/main/org/h2/command/dml/Select.java
浏览文件 @
fdcd54e3
...
...
@@ -826,7 +826,7 @@ public class Select extends Query {
visibleColumnCount
=
expressions
.
size
();
ArrayList
<
String
>
expressionSQL
;
if
(
orderList
!=
null
||
group
!=
null
)
{
expressionSQL
=
Utils
.
newSmallArrayList
(
);
expressionSQL
=
new
ArrayList
<>(
visibleColumnCount
);
for
(
int
i
=
0
;
i
<
visibleColumnCount
;
i
++)
{
Expression
expr
=
expressions
.
get
(
i
);
expr
=
expr
.
getNonAliasExpression
();
...
...
@@ -1043,7 +1043,7 @@ public class Select extends Query {
@Override
public
void
prepareJoinBatch
()
{
ArrayList
<
TableFilter
>
list
=
Utils
.
newSmallArrayList
();
ArrayList
<
TableFilter
>
list
=
new
ArrayList
<>
();
TableFilter
f
=
getTopTableFilter
();
do
{
if
(
f
.
getNestedJoin
()
!=
null
)
{
...
...
h2/src/main/org/h2/command/dml/SelectUnion.java
浏览文件 @
fdcd54e3
...
...
@@ -29,7 +29,6 @@ import org.h2.table.Table;
import
org.h2.table.TableFilter
;
import
org.h2.util.ColumnNamer
;
import
org.h2.util.StringUtils
;
import
org.h2.util.Utils
;
import
org.h2.value.Value
;
import
org.h2.value.ValueInt
;
import
org.h2.value.ValueNull
;
...
...
@@ -318,7 +317,7 @@ public class SelectUnion extends Query {
ArrayList
<
Expression
>
le
=
left
.
getExpressions
();
// set the expressions to get the right column count and names,
// but can't validate at this time
expressions
=
Utils
.
newSmallArrayList
(
);
expressions
=
new
ArrayList
<>(
len
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Expression
l
=
le
.
get
(
i
);
expressions
.
add
(
l
);
...
...
@@ -339,7 +338,7 @@ public class SelectUnion extends Query {
right
.
prepare
();
int
len
=
left
.
getColumnCount
();
// set the correct expressions now
expressions
=
Utils
.
newSmallArrayList
(
);
expressions
=
new
ArrayList
<>(
len
);
ArrayList
<
Expression
>
le
=
left
.
getExpressions
();
ArrayList
<
Expression
>
re
=
right
.
getExpressions
();
ColumnNamer
columnNamer
=
new
ColumnNamer
(
session
);
...
...
h2/src/main/org/h2/engine/Database.java
浏览文件 @
fdcd54e3
...
...
@@ -761,7 +761,7 @@ public class Database implements DataHandler {
objectIds
.
set
(
0
);
starting
=
true
;
Cursor
cursor
=
metaIdIndex
.
find
(
systemSession
,
null
,
null
);
ArrayList
<
MetaRecord
>
records
=
new
ArrayList
<>();
ArrayList
<
MetaRecord
>
records
=
new
ArrayList
<>(
(
int
)
metaIdIndex
.
getRowCountApproximation
()
);
while
(
cursor
.
next
())
{
MetaRecord
rec
=
new
MetaRecord
(
cursor
.
get
());
objectIds
.
set
(
rec
.
getId
());
...
...
h2/src/main/org/h2/engine/FunctionAlias.java
浏览文件 @
fdcd54e3
...
...
@@ -144,7 +144,7 @@ public class FunctionAlias extends SchemaObjectBase {
private
void
loadClass
()
{
Class
<?>
javaClass
=
JdbcUtils
.
loadUserClass
(
className
);
Method
[]
methods
=
javaClass
.
getMethods
();
ArrayList
<
JavaMethod
>
list
=
new
ArrayList
<>();
ArrayList
<
JavaMethod
>
list
=
new
ArrayList
<>(
1
);
for
(
int
i
=
0
,
len
=
methods
.
length
;
i
<
len
;
i
++)
{
Method
m
=
methods
[
i
];
if
(!
Modifier
.
isStatic
(
m
.
getModifiers
()))
{
...
...
h2/src/main/org/h2/engine/Session.java
浏览文件 @
fdcd54e3
...
...
@@ -693,8 +693,8 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
if
(
undoLog
.
size
()
>
0
)
{
// commit the rows when using MVCC
if
(
database
.
isMultiVersion
())
{
ArrayList
<
Row
>
rows
=
Utils
.
newSmallArrayList
();
synchronized
(
database
)
{
ArrayList
<
Row
>
rows
=
new
ArrayList
<>(
undoLog
.
size
());
while
(
undoLog
.
size
()
>
0
)
{
UndoLogRecord
entry
=
undoLog
.
getLast
();
entry
.
commit
();
...
...
@@ -1462,7 +1462,7 @@ public class Session extends SessionWithState implements TransactionStore.Rollba
public
Table
[]
getLocks
()
{
// copy the data without synchronizing
ArrayList
<
Table
>
copy
=
Utils
.
newSmallArrayList
(
);
ArrayList
<
Table
>
copy
=
new
ArrayList
<>(
locks
.
size
()
);
for
(
Table
lock
:
locks
)
{
try
{
copy
.
add
(
lock
);
...
...
h2/src/main/org/h2/index/ViewIndex.java
浏览文件 @
fdcd54e3
...
...
@@ -30,7 +30,6 @@ import org.h2.table.JoinBatch;
import
org.h2.table.TableFilter
;
import
org.h2.table.TableView
;
import
org.h2.util.IntArray
;
import
org.h2.util.Utils
;
import
org.h2.value.Value
;
/**
...
...
@@ -335,7 +334,7 @@ public class ViewIndex extends BaseIndex implements SpatialIndex {
}
}
int
len
=
paramColumnIndex
.
size
();
ArrayList
<
Column
>
columnList
=
Utils
.
newSmallArrayList
(
);
ArrayList
<
Column
>
columnList
=
new
ArrayList
<>(
len
);
for
(
int
i
=
0
;
i
<
len
;)
{
int
idx
=
paramColumnIndex
.
get
(
i
);
columnList
.
add
(
table
.
getColumn
(
idx
));
...
...
h2/src/main/org/h2/mvstore/db/MVSecondaryIndex.java
浏览文件 @
fdcd54e3
...
...
@@ -29,7 +29,6 @@ import org.h2.result.SortOrder;
import
org.h2.table.Column
;
import
org.h2.table.IndexColumn
;
import
org.h2.table.TableFilter
;
import
org.h2.util.Utils
;
import
org.h2.value.CompareMode
;
import
org.h2.value.Value
;
import
org.h2.value.ValueArray
;
...
...
@@ -401,7 +400,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
}
key
=
first
?
map
.
higherKey
(
key
)
:
map
.
lowerKey
(
key
);
}
ArrayList
<
Value
>
list
=
Utils
.
newSmallArrayList
(
);
ArrayList
<
Value
>
list
=
new
ArrayList
<>(
1
);
list
.
add
(
key
);
MVStoreCursor
cursor
=
new
MVStoreCursor
(
session
,
list
.
iterator
(),
null
);
cursor
.
next
();
...
...
h2/src/main/org/h2/mvstore/db/MVTable.java
浏览文件 @
fdcd54e3
...
...
@@ -377,7 +377,7 @@ public class MVTable extends TableBase {
visited
=
new
HashSet
<>();
}
else
if
(
clash
==
session
)
{
// we found a circle where this session is involved
return
Utils
.
newSmallArrayList
(
);
return
new
ArrayList
<>(
0
);
}
else
if
(
visited
.
contains
(
session
))
{
// we have already checked this session.
// there is a circle, but the sessions in the circle need to
...
...
h2/src/main/org/h2/mvstore/rtree/MVRTreeMap.java
浏览文件 @
fdcd54e3
...
...
@@ -14,7 +14,6 @@ import org.h2.mvstore.DataUtils;
import
org.h2.mvstore.MVMap
;
import
org.h2.mvstore.Page
;
import
org.h2.mvstore.type.DataType
;
import
org.h2.util.Utils
;
/**
* An r-tree implementation. It supports both the linear and the quadratic split
...
...
@@ -311,8 +310,8 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
}
private
Page
splitLinear
(
Page
p
)
{
ArrayList
<
Object
>
keys
=
Utils
.
newSmallArrayList
();
int
keyCount
=
p
.
getKeyCount
();
ArrayList
<
Object
>
keys
=
new
ArrayList
<>(
keyCount
);
for
(
int
i
=
0
;
i
<
keyCount
;
i
++)
{
keys
.
add
(
p
.
getKey
(
i
));
}
...
...
h2/src/main/org/h2/mvstore/rtree/SpatialDataType.java
浏览文件 @
fdcd54e3
...
...
@@ -11,7 +11,6 @@ import java.util.ArrayList;
import
org.h2.mvstore.DataUtils
;
import
org.h2.mvstore.WriteBuffer
;
import
org.h2.mvstore.type.DataType
;
import
org.h2.util.Utils
;
/**
* A spatial data type. This class supports up to 31 dimensions. Each dimension
...
...
@@ -353,17 +352,18 @@ public class SpatialDataType implements DataType {
}
private
static
ArrayList
<
Object
>
getNotNull
(
ArrayList
<
Object
>
list
)
{
ArrayList
<
Object
>
result
=
null
;
boolean
foundNull
=
false
;
for
(
Object
o
:
list
)
{
SpatialKey
a
=
(
SpatialKey
)
o
;
if
(
a
.
isNull
())
{
result
=
Utils
.
newSmallArrayList
()
;
foundNull
=
true
;
break
;
}
}
if
(
result
==
n
ull
)
{
if
(
!
foundN
ull
)
{
return
list
;
}
ArrayList
<
Object
>
result
=
new
ArrayList
<>();
for
(
Object
o
:
list
)
{
SpatialKey
a
=
(
SpatialKey
)
o
;
if
(!
a
.
isNull
())
{
...
...
h2/src/main/org/h2/result/ResultRemote.java
浏览文件 @
fdcd54e3
...
...
@@ -13,7 +13,6 @@ import org.h2.engine.SessionRemote;
import
org.h2.engine.SysProperties
;
import
org.h2.message.DbException
;
import
org.h2.message.Trace
;
import
org.h2.util.Utils
;
import
org.h2.value.Transfer
;
import
org.h2.value.Value
;
...
...
@@ -47,7 +46,7 @@ public class ResultRemote implements ResultInterface {
columns
[
i
]
=
new
ResultColumn
(
transfer
);
}
rowId
=
-
1
;
result
=
Utils
.
newSmallArrayList
(
);
result
=
new
ArrayList
<>(
Math
.
min
(
fetchSize
,
rowCount
)
);
this
.
fetchSize
=
fetchSize
;
fetchRows
(
false
);
}
...
...
h2/src/main/org/h2/server/web/WebServer.java
浏览文件 @
fdcd54e3
...
...
@@ -469,7 +469,7 @@ public class WebServer implements Service {
}
ArrayList
<
HashMap
<
String
,
Object
>>
getSessions
()
{
ArrayList
<
HashMap
<
String
,
Object
>>
list
=
new
ArrayList
<>();
ArrayList
<
HashMap
<
String
,
Object
>>
list
=
new
ArrayList
<>(
sessions
.
size
()
);
for
(
WebSession
s
:
sessions
.
values
())
{
list
.
add
(
s
.
getInfo
());
}
...
...
h2/src/main/org/h2/store/fs/FilePathDisk.java
浏览文件 @
fdcd54e3
...
...
@@ -170,6 +170,7 @@ public class FilePathDisk extends FilePath {
if
(!
base
.
endsWith
(
SysProperties
.
FILE_SEPARATOR
))
{
base
+=
SysProperties
.
FILE_SEPARATOR
;
}
list
.
ensureCapacity
(
files
.
length
);
for
(
String
file
:
files
)
{
list
.
add
(
getPath
(
base
+
file
));
}
...
...
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
fdcd54e3
...
...
@@ -1046,8 +1046,8 @@ public class MetaTable extends Table {
add
(
rows
,
"RETENTION_TIME"
,
Integer
.
toString
(
database
.
getRetentionTime
()));
add
(
rows
,
"LOG"
,
Integer
.
toString
(
database
.
getLogMode
()));
// database settings
ArrayList
<
String
>
settingNames
=
Utils
.
newSmallArrayList
();
HashMap
<
String
,
String
>
s
=
database
.
getSettings
().
getSettings
();
ArrayList
<
String
>
settingNames
=
new
ArrayList
<>(
s
.
size
());
settingNames
.
addAll
(
s
.
keySet
());
Collections
.
sort
(
settingNames
);
for
(
String
k
:
settingNames
)
{
...
...
@@ -2288,7 +2288,7 @@ public class MetaTable extends Table {
@Override
public
ArrayList
<
Index
>
getIndexes
()
{
ArrayList
<
Index
>
list
=
Utils
.
newSmallArrayList
(
);
ArrayList
<
Index
>
list
=
new
ArrayList
<>(
2
);
if
(
metaIndex
==
null
)
{
return
list
;
}
...
...
h2/src/main/org/h2/table/Plan.java
浏览文件 @
fdcd54e3
...
...
@@ -15,7 +15,6 @@ import org.h2.expression.Expression;
import
org.h2.expression.ExpressionVisitor
;
import
org.h2.message.Trace
;
import
org.h2.table.TableFilter.TableFilterVisitor
;
import
org.h2.util.Utils
;
/**
* A possible query execution plan. The time required to execute a query depends
...
...
@@ -38,8 +37,8 @@ public class Plan {
public
Plan
(
TableFilter
[]
filters
,
int
count
,
Expression
condition
)
{
this
.
filters
=
new
TableFilter
[
count
];
System
.
arraycopy
(
filters
,
0
,
this
.
filters
,
0
,
count
);
final
ArrayList
<
Expression
>
allCond
=
Utils
.
newSmallArrayList
();
final
ArrayList
<
TableFilter
>
all
=
Utils
.
newSmallArrayList
();
final
ArrayList
<
Expression
>
allCond
=
new
ArrayList
<>
();
final
ArrayList
<
TableFilter
>
all
=
new
ArrayList
<>
();
if
(
condition
!=
null
)
{
allCond
.
add
(
condition
);
}
...
...
h2/src/main/org/h2/table/RegularTable.java
浏览文件 @
fdcd54e3
...
...
@@ -614,11 +614,11 @@ public class RegularTable extends TableBase {
clash
=
session
;
visited
=
new
HashSet
<>();
}
else
if
(
clash
==
session
)
{
// we found a c
ir
cle where this session is involved
return
Utils
.
newSmallArrayList
(
);
// we found a c
y
cle where this session is involved
return
new
ArrayList
<>(
0
);
}
else
if
(
visited
.
contains
(
session
))
{
// we have already checked this session.
// there is a c
ircle, but the sessions in the cir
cle need to
// there is a c
ycle, but the sessions in the cy
cle need to
// find it out themselves
return
null
;
}
...
...
h2/src/main/org/h2/table/TableView.java
浏览文件 @
fdcd54e3
...
...
@@ -175,9 +175,10 @@ public class TableView extends Table {
this
.
querySQL
=
compiledQuery
.
getPlanSQL
();
tables
=
new
ArrayList
<>(
compiledQuery
.
getTables
());
ArrayList
<
Expression
>
expressions
=
compiledQuery
.
getExpressions
();
ArrayList
<
Column
>
list
=
Utils
.
newSmallArrayList
();
ColumnNamer
columnNamer
=
new
ColumnNamer
(
session
);
for
(
int
i
=
0
,
count
=
compiledQuery
.
getColumnCount
();
i
<
count
;
i
++)
{
final
int
count
=
compiledQuery
.
getColumnCount
();
ArrayList
<
Column
>
list
=
new
ArrayList
<>(
count
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
Expression
expr
=
expressions
.
get
(
i
);
String
name
=
null
;
int
type
=
Value
.
UNKNOWN
;
...
...
h2/src/main/org/h2/tools/MultiDimension.java
浏览文件 @
fdcd54e3
...
...
@@ -11,7 +11,6 @@ import java.sql.SQLException;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
org.h2.util.StringUtils
;
/**
...
...
h2/src/main/org/h2/util/CacheTQ.java
浏览文件 @
fdcd54e3
...
...
@@ -74,9 +74,11 @@ public class CacheTQ implements Cache {
@Override
public
ArrayList
<
CacheObject
>
getAllChanged
()
{
ArrayList
<
CacheObject
>
changed
=
new
ArrayList
<>();
changed
.
addAll
(
lru
.
getAllChanged
());
changed
.
addAll
(
fifo
.
getAllChanged
());
ArrayList
<
CacheObject
>
lruChanged
=
lru
.
getAllChanged
();
ArrayList
<
CacheObject
>
fifoChanged
=
fifo
.
getAllChanged
();
ArrayList
<
CacheObject
>
changed
=
new
ArrayList
<>(
lruChanged
.
size
()
+
fifoChanged
.
size
());
changed
.
addAll
(
lruChanged
);
changed
.
addAll
(
fifoChanged
);
return
changed
;
}
...
...
h2/src/test/org/h2/test/db/TestCsv.java
浏览文件 @
fdcd54e3
...
...
@@ -352,7 +352,7 @@ public class TestCsv extends TestBase {
int
len
=
getSize
(
1000
,
10000
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test(a, b) values(?, ?)"
);
ArrayList
<
String
[]>
list
=
new
ArrayList
<>();
ArrayList
<
String
[]>
list
=
new
ArrayList
<>(
len
);
Random
random
=
new
Random
(
1
);
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
String
a
=
randomData
(
random
),
b
=
randomData
(
random
);
...
...
h2/src/test/org/h2/test/db/TestMultiThreadedKernel.java
浏览文件 @
fdcd54e3
...
...
@@ -103,9 +103,9 @@ public class TestMultiThreadedKernel extends TestBase {
}
private
void
testConcurrentRead
()
throws
Exception
{
ArrayList
<
Task
>
list
=
new
ArrayList
<>();
int
size
=
2
;
final
int
count
=
1000
;
ArrayList
<
Task
>
list
=
new
ArrayList
<>(
size
);
final
Connection
[]
connections
=
new
Connection
[
count
];
String
url
=
getURL
(
"multiThreadedKernel;"
+
"MULTI_THREADED=TRUE;CACHE_SIZE=16"
,
true
);
...
...
@@ -144,9 +144,9 @@ public class TestMultiThreadedKernel extends TestBase {
}
private
void
testCache
()
throws
Exception
{
ArrayList
<
Task
>
list
=
new
ArrayList
<>();
int
size
=
3
;
final
int
count
=
100
;
ArrayList
<
Task
>
list
=
new
ArrayList
<>(
size
);
final
Connection
[]
connections
=
new
Connection
[
count
];
String
url
=
getURL
(
"multiThreadedKernel;"
+
"MULTI_THREADED=TRUE;CACHE_SIZE=1"
,
true
);
...
...
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
浏览文件 @
fdcd54e3
...
...
@@ -65,7 +65,7 @@ public class SupportedTypes {
private
java
.
sql
.
Timestamp
mySqlTimestamp
;
static
List
<
SupportedTypes
>
createList
()
{
List
<
SupportedTypes
>
list
=
new
ArrayList
<>();
List
<
SupportedTypes
>
list
=
new
ArrayList
<>(
10
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
list
.
add
(
randomValue
());
}
...
...
h2/src/test/org/h2/test/store/TestConcurrent.java
浏览文件 @
fdcd54e3
...
...
@@ -387,7 +387,7 @@ public class TestConcurrent extends TestMVStore {
fileName
(
fileName
).
autoCommitDisabled
().
open
();
try
{
s
.
setRetentionTime
(
0
);
final
ArrayList
<
MVMap
<
Integer
,
Integer
>>
list
=
new
ArrayList
<>();
final
ArrayList
<
MVMap
<
Integer
,
Integer
>>
list
=
new
ArrayList
<>(
count
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
MVMap
<
Integer
,
Integer
>
m
=
s
.
openMap
(
"d"
+
i
);
list
.
add
(
m
);
...
...
h2/src/test/org/h2/test/store/TestMVRTree.java
浏览文件 @
fdcd54e3
...
...
@@ -220,7 +220,7 @@ public class TestMVRTree extends TestMVStore {
add
(
r
,
"Bellinzona"
,
key
(
11
,
46.12
,
9.01
,
17373
));
add
(
r
,
"Chur"
,
key
(
12
,
46.51
,
9.32
,
33756
));
// render(r, getBaseDir() + "/test.png");
ArrayList
<
String
>
list
=
new
ArrayList
<>();
ArrayList
<
String
>
list
=
new
ArrayList
<>(
r
.
size
()
);
for
(
SpatialKey
x
:
r
.
keySet
())
{
list
.
add
(
r
.
get
(
x
));
}
...
...
h2/src/test/org/h2/test/store/TestMVStoreBenchmark.java
浏览文件 @
fdcd54e3
...
...
@@ -77,7 +77,7 @@ public class TestMVStoreBenchmark extends TestBase {
ArrayList
<
Map
<
Integer
,
String
>>
mapList
;
long
mem
;
mapList
=
new
ArrayList
<>();
mapList
=
new
ArrayList
<>(
count
);
mem
=
getMemory
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
mapList
.
add
(
new
HashMap
<
Integer
,
String
>(
size
));
...
...
@@ -86,7 +86,7 @@ public class TestMVStoreBenchmark extends TestBase {
hash
=
getMemory
()
-
mem
;
mapList
.
size
();
mapList
=
new
ArrayList
<>
();
mapList
.
clear
();
mem
=
getMemory
();
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
mapList
.
add
(
new
TreeMap
<
Integer
,
String
>());
...
...
@@ -95,7 +95,7 @@ public class TestMVStoreBenchmark extends TestBase {
tree
=
getMemory
()
-
mem
;
mapList
.
size
();
mapList
=
new
ArrayList
<>
();
mapList
.
clear
();
mem
=
getMemory
();
MVStore
store
=
MVStore
.
open
(
null
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
...
...
h2/src/test/org/h2/test/synth/sql/TestSynth.java
浏览文件 @
fdcd54e3
...
...
@@ -201,7 +201,6 @@ public class TestSynth extends TestBase {
private
boolean
process
(
int
seed
,
int
id
,
Command
command
)
throws
Exception
{
try
{
ArrayList
<
Result
>
results
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
databases
.
size
();
i
++)
{
DbInterface
db
=
databases
.
get
(
i
);
...
...
h2/src/test/org/h2/test/unit/TestFileLockProcess.java
浏览文件 @
fdcd54e3
...
...
@@ -76,7 +76,7 @@ public class TestFileLockProcess extends TestBase {
String
[]
procDef
=
{
"java"
,
selfDestruct
,
"-cp"
,
getClassPath
(),
getClass
().
getName
(),
url
};
ArrayList
<
Process
>
processes
=
new
ArrayList
<>();
ArrayList
<
Process
>
processes
=
new
ArrayList
<>(
count
);
for
(
int
i
=
0
;
i
<
count
;
i
++)
{
Thread
.
sleep
(
100
);
if
(
i
%
10
==
0
)
{
...
...
h2/src/test/org/h2/test/unit/TestPageStore.java
浏览文件 @
fdcd54e3
...
...
@@ -178,7 +178,7 @@ public class TestPageStore extends TestBase {
stat
.
execute
(
"insert into test "
+
"select x, space(1100+x) from system_range(1, 100)"
);
Random
r
=
new
Random
(
1
);
ArrayList
<
Connection
>
list
=
new
ArrayList
<>();
ArrayList
<
Connection
>
list
=
new
ArrayList
<>(
10
);
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
Connection
conn2
=
getConnection
(
url
,
getUser
(),
getPassword
());
list
.
add
(
conn2
);
...
...
h2/src/tools/org/h2/dev/fs/ArchiveToolStore.java
浏览文件 @
fdcd54e3
...
...
@@ -160,7 +160,7 @@ public class ArchiveToolStore {
filesTemp
.
put
(
name
,
posArray
);
}
storeTemp
.
commit
();
ArrayList
<
Cursor
<
int
[],
byte
[]>>
list
=
new
ArrayList
<>();
ArrayList
<
Cursor
<
int
[],
byte
[]>>
list
=
new
ArrayList
<>(
segmentId
-
1
);
totalSize
=
0
;
for
(
int
i
=
1
;
i
<=
segmentId
;
i
++)
{
MVMap
<
int
[],
byte
[]>
data
=
storeTemp
.
openMap
(
"data"
+
i
);
...
...
@@ -379,7 +379,7 @@ public class ArchiveToolStore {
storeTemp
.
commit
();
}
ArrayList
<
Cursor
<
int
[],
byte
[]>>
list
=
new
ArrayList
<>();
ArrayList
<
Cursor
<
int
[],
byte
[]>>
list
=
new
ArrayList
<>(
lastSegment
-
1
);
totalSize
=
0
;
currentSize
=
0
;
for
(
int
i
=
1
;
i
<=
lastSegment
;
i
++)
{
...
...
h2/src/tools/org/h2/jaqu/DbInspector.java
浏览文件 @
fdcd54e3
...
...
@@ -58,8 +58,8 @@ public class DbInspector {
public
List
<
String
>
generateModel
(
String
schema
,
String
table
,
String
packageName
,
boolean
annotateSchema
,
boolean
trimStrings
)
{
try
{
List
<
String
>
models
=
new
ArrayList
<>();
List
<
TableInspector
>
tables
=
getTables
(
schema
,
table
);
List
<
String
>
models
=
new
ArrayList
<>(
tables
.
size
());
for
(
TableInspector
t
:
tables
)
{
t
.
read
(
metaData
);
String
model
=
t
.
generateModel
(
packageName
,
annotateSchema
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论