Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
297910b0
提交
297910b0
authored
12月 28, 2018
作者:
igor-suhorukov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove explicit unboxing
上级
9cd06d96
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
43 行增加
和
43 行删除
+43
-43
SysProperties.java
h2/src/main/org/h2/engine/SysProperties.java
+1
-1
DateTimeFunctions.java
...rc/main/org/h2/expression/function/DateTimeFunctions.java
+1
-1
FullText.java
h2/src/main/org/h2/fulltext/FullText.java
+1
-1
JdbcResultSet.java
h2/src/main/org/h2/jdbc/JdbcResultSet.java
+1
-1
ObjectDataType.java
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
+3
-3
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+2
-2
WebApp.java
h2/src/main/org/h2/server/web/WebApp.java
+2
-2
FilePathSplit.java
h2/src/main/org/h2/store/fs/FilePathSplit.java
+1
-1
SmallMap.java
h2/src/main/org/h2/util/SmallMap.java
+1
-1
DataType.java
h2/src/main/org/h2/value/DataType.java
+7
-7
Function.java
h2/src/test/org/h2/samples/Function.java
+1
-1
FunctionMultiReturn.java
h2/src/test/org/h2/samples/FunctionMultiReturn.java
+6
-6
TestFunctions.java
h2/src/test/org/h2/test/db/TestFunctions.java
+2
-2
TestResultSet.java
h2/src/test/org/h2/test/jdbc/TestResultSet.java
+10
-10
MinimalPerfectHash.java
h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java
+2
-2
FileViewer.java
h2/src/tools/org/h2/dev/util/FileViewer.java
+2
-2
没有找到文件。
h2/src/main/org/h2/engine/SysProperties.java
浏览文件 @
297910b0
...
...
@@ -624,7 +624,7 @@ public class SysProperties {
String
s
=
Utils
.
getProperty
(
key
,
null
);
if
(
s
!=
null
)
{
try
{
return
Integer
.
decode
(
s
)
.
intValue
()
;
return
Integer
.
decode
(
s
);
}
catch
(
NumberFormatException
e
)
{
// ignore
}
...
...
h2/src/main/org/h2/expression/function/DateTimeFunctions.java
浏览文件 @
297910b0
...
...
@@ -614,7 +614,7 @@ public final class DateTimeFunctions {
if
(
p
==
null
)
{
throw
DbException
.
getInvalidValueException
(
"date part"
,
part
);
}
return
p
.
intValue
()
;
return
p
;
}
/**
...
...
h2/src/main/org/h2/fulltext/FullText.java
浏览文件 @
297910b0
...
...
@@ -619,7 +619,7 @@ public class FullText {
if
(
wId
==
null
)
{
continue
;
}
prepSelectMapByWordId
.
setInt
(
1
,
wId
.
intValue
()
);
prepSelectMapByWordId
.
setInt
(
1
,
wId
);
ResultSet
rs
=
prepSelectMapByWordId
.
executeQuery
();
while
(
rs
.
next
())
{
Integer
rId
=
rs
.
getInt
(
1
);
...
...
h2/src/main/org/h2/jdbc/JdbcResultSet.java
浏览文件 @
297910b0
...
...
@@ -3187,7 +3187,7 @@ public class JdbcResultSet extends TraceObject implements ResultSet, JdbcResultS
if
(
index
==
null
)
{
throw
DbException
.
get
(
ErrorCode
.
COLUMN_NOT_FOUND_1
,
columnLabel
);
}
return
index
.
intValue
()
+
1
;
return
index
+
1
;
}
for
(
int
i
=
0
;
i
<
columnCount
;
i
++)
{
if
(
columnLabel
.
equalsIgnoreCase
(
result
.
getAlias
(
i
)))
{
...
...
h2/src/main/org/h2/mvstore/type/ObjectDataType.java
浏览文件 @
297910b0
...
...
@@ -596,7 +596,7 @@ public class ObjectDataType implements DataType {
return
;
}
buff
.
put
((
byte
)
TYPE_BYTE
);
buff
.
put
((
(
Byte
)
obj
).
byteValue
()
);
buff
.
put
((
Byte
)
obj
);
}
@Override
...
...
@@ -637,7 +637,7 @@ public class ObjectDataType implements DataType {
return
;
}
buff
.
put
((
byte
)
TYPE_CHAR
);
buff
.
putChar
((
(
Character
)
obj
).
charValue
()
);
buff
.
putChar
((
Character
)
obj
);
}
@Override
...
...
@@ -678,7 +678,7 @@ public class ObjectDataType implements DataType {
return
;
}
buff
.
put
((
byte
)
TYPE_SHORT
);
buff
.
putShort
((
(
Short
)
obj
).
shortValue
()
);
buff
.
putShort
((
Short
)
obj
);
}
@Override
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
297910b0
...
...
@@ -308,7 +308,7 @@ public class PgServer implements Service {
@SuppressWarnings
(
"unused"
)
public
static
String
getIndexColumn
(
Connection
conn
,
int
indexId
,
Integer
ordinalPosition
,
Boolean
pretty
)
throws
SQLException
{
if
(
ordinalPosition
==
null
||
ordinalPosition
.
intValue
()
==
0
)
{
if
(
ordinalPosition
==
null
||
ordinalPosition
==
0
)
{
PreparedStatement
prep
=
conn
.
prepareStatement
(
"select sql from information_schema.indexes where id=?"
);
prep
.
setInt
(
1
,
indexId
);
...
...
@@ -322,7 +322,7 @@ public class PgServer implements Service {
"select column_name from information_schema.indexes "
+
"where id=? and ordinal_position=?"
);
prep
.
setInt
(
1
,
indexId
);
prep
.
setInt
(
2
,
ordinalPosition
.
intValue
()
);
prep
.
setInt
(
2
,
ordinalPosition
);
ResultSet
rs
=
prep
.
executeQuery
();
if
(
rs
.
next
())
{
return
rs
.
getString
(
1
);
...
...
h2/src/main/org/h2/server/web/WebApp.java
浏览文件 @
297910b0
...
...
@@ -1451,7 +1451,7 @@ public class WebApp {
String
s
=
sql
;
for
(
Integer
type
:
params
)
{
idx
=
s
.
indexOf
(
'?'
);
if
(
type
.
intValue
()
==
1
)
{
if
(
type
==
1
)
{
s
=
s
.
substring
(
0
,
idx
)
+
random
.
nextInt
(
count
)
+
s
.
substring
(
idx
+
1
);
}
else
{
s
=
s
.
substring
(
0
,
idx
)
+
i
+
s
.
substring
(
idx
+
1
);
...
...
@@ -1471,7 +1471,7 @@ public class WebApp {
for
(
int
i
=
0
;
!
stop
&&
i
<
count
;
i
++)
{
for
(
int
j
=
0
;
j
<
params
.
size
();
j
++)
{
Integer
type
=
params
.
get
(
j
);
if
(
type
.
intValue
()
==
1
)
{
if
(
type
==
1
)
{
prep
.
setInt
(
j
+
1
,
random
.
nextInt
(
count
));
}
else
{
prep
.
setInt
(
j
+
1
,
i
);
...
...
h2/src/main/org/h2/store/fs/FilePathSplit.java
浏览文件 @
297910b0
...
...
@@ -161,7 +161,7 @@ public class FilePathSplit extends FilePathWrapper {
}
private
long
getDefaultMaxLength
()
{
return
1L
<<
Integer
.
decode
(
parse
(
name
)[
0
])
.
intValue
()
;
return
1L
<<
Integer
.
decode
(
parse
(
name
)[
0
]);
}
private
void
closeAndThrow
(
int
id
,
FileChannel
[]
array
,
FileChannel
o
,
...
...
h2/src/main/org/h2/util/SmallMap.java
浏览文件 @
297910b0
...
...
@@ -44,7 +44,7 @@ public class SmallMap {
Iterator
<
Integer
>
it
=
map
.
keySet
().
iterator
();
while
(
it
.
hasNext
())
{
Integer
k
=
it
.
next
();
if
(
k
.
intValue
()
+
maxElements
<
lastId
)
{
if
(
k
+
maxElements
<
lastId
)
{
it
.
remove
();
}
}
...
...
h2/src/main/org/h2/value/DataType.java
浏览文件 @
297910b0
...
...
@@ -1196,23 +1196,23 @@ public class DataType {
}
else
if
(
x
instanceof
Value
)
{
return
(
Value
)
x
;
}
else
if
(
x
instanceof
Long
)
{
return
ValueLong
.
get
((
(
Long
)
x
).
longValue
()
);
return
ValueLong
.
get
((
Long
)
x
);
}
else
if
(
x
instanceof
Integer
)
{
return
ValueInt
.
get
((
(
Integer
)
x
).
intValue
()
);
return
ValueInt
.
get
((
Integer
)
x
);
}
else
if
(
x
instanceof
BigInteger
)
{
return
ValueDecimal
.
get
(
new
BigDecimal
((
BigInteger
)
x
));
}
else
if
(
x
instanceof
BigDecimal
)
{
return
ValueDecimal
.
get
((
BigDecimal
)
x
);
}
else
if
(
x
instanceof
Boolean
)
{
return
ValueBoolean
.
get
((
(
Boolean
)
x
).
booleanValue
()
);
return
ValueBoolean
.
get
((
Boolean
)
x
);
}
else
if
(
x
instanceof
Byte
)
{
return
ValueByte
.
get
((
(
Byte
)
x
).
byteValue
()
);
return
ValueByte
.
get
((
Byte
)
x
);
}
else
if
(
x
instanceof
Short
)
{
return
ValueShort
.
get
((
(
Short
)
x
).
shortValue
()
);
return
ValueShort
.
get
((
Short
)
x
);
}
else
if
(
x
instanceof
Float
)
{
return
ValueFloat
.
get
((
(
Float
)
x
).
floatValue
()
);
return
ValueFloat
.
get
((
Float
)
x
);
}
else
if
(
x
instanceof
Double
)
{
return
ValueDouble
.
get
((
(
Double
)
x
).
doubleValue
()
);
return
ValueDouble
.
get
((
Double
)
x
);
}
else
if
(
x
instanceof
byte
[])
{
return
ValueBytes
.
get
((
byte
[])
x
);
}
else
if
(
x
instanceof
Date
)
{
...
...
h2/src/test/org/h2/samples/Function.java
浏览文件 @
297910b0
...
...
@@ -145,7 +145,7 @@ public class Function {
if
(
url
.
equals
(
"jdbc:columnlist:connection"
))
{
return
rs
;
}
for
(
int
s
=
size
.
intValue
()
,
x
=
0
;
x
<
s
;
x
++)
{
for
(
int
s
=
size
,
x
=
0
;
x
<
s
;
x
++)
{
for
(
int
y
=
0
;
y
<
s
;
y
++)
{
rs
.
addRow
(
x
,
y
);
}
...
...
h2/src/test/org/h2/samples/FunctionMultiReturn.java
浏览文件 @
297910b0
...
...
@@ -71,8 +71,8 @@ public class FunctionMultiReturn {
double
a
=
rs
.
getDouble
(
2
);
Object
o
=
rs
.
getObject
(
3
);
Object
[]
xy
=
(
Object
[])
o
;
double
x
=
(
(
Double
)
xy
[
0
]).
doubleValue
()
;
double
y
=
(
(
Double
)
xy
[
1
]).
doubleValue
()
;
double
x
=
(
Double
)
xy
[
0
]
;
double
y
=
(
Double
)
xy
[
1
]
;
System
.
out
.
println
(
"(r="
+
r
+
" a="
+
a
+
") :"
+
" (x="
+
x
+
", y="
+
y
+
")"
);
}
...
...
@@ -108,8 +108,8 @@ public class FunctionMultiReturn {
rs
.
addColumn
(
"X"
,
Types
.
DOUBLE
,
0
,
0
);
rs
.
addColumn
(
"Y"
,
Types
.
DOUBLE
,
0
,
0
);
if
(
r
!=
null
&&
alpha
!=
null
)
{
double
x
=
r
.
doubleValue
()
*
Math
.
cos
(
alpha
.
doubleValue
()
);
double
y
=
r
.
doubleValue
()
*
Math
.
sin
(
alpha
.
doubleValue
()
);
double
x
=
r
*
Math
.
cos
(
alpha
);
double
y
=
r
*
Math
.
sin
(
alpha
);
rs
.
addRow
(
x
,
y
);
}
return
rs
;
...
...
@@ -125,8 +125,8 @@ public class FunctionMultiReturn {
* @return an array two values: x and y
*/
public
static
Object
[]
polar2CartesianArray
(
Double
r
,
Double
alpha
)
{
double
x
=
r
.
doubleValue
()
*
Math
.
cos
(
alpha
.
doubleValue
()
);
double
y
=
r
.
doubleValue
()
*
Math
.
sin
(
alpha
.
doubleValue
()
);
double
x
=
r
*
Math
.
cos
(
alpha
);
double
y
=
r
*
Math
.
sin
(
alpha
);
return
new
Object
[]{
x
,
y
};
}
...
...
h2/src/test/org/h2/test/db/TestFunctions.java
浏览文件 @
297910b0
...
...
@@ -2375,10 +2375,10 @@ public class TestFunctions extends TestDb implements AggregateFunction {
sp
!=
1
||
lp
!=
1
||
byParam
!=
1
)
{
throw
new
AssertionError
(
"params not 1/true"
);
}
if
(
rowCount
.
intValue
()
>=
1
)
{
if
(
rowCount
>=
1
)
{
rs
.
addRow
(
0
,
"Hello"
);
}
if
(
rowCount
.
intValue
()
>=
2
)
{
if
(
rowCount
>=
2
)
{
rs
.
addRow
(
1
,
"World"
);
}
}
...
...
h2/src/test/org/h2/test/jdbc/TestResultSet.java
浏览文件 @
297910b0
...
...
@@ -693,19 +693,19 @@ public class TestResultSet extends TestDb {
o
=
rs
.
getObject
(
"value"
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
((
(
Integer
)
o
).
intValue
()
==
-
1
);
assertTrue
((
Integer
)
o
==
-
1
);
o
=
rs
.
getObject
(
"value"
,
Integer
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
((
(
Integer
)
o
).
intValue
()
==
-
1
);
assertTrue
((
Integer
)
o
==
-
1
);
o
=
rs
.
getObject
(
2
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
((
(
Integer
)
o
).
intValue
()
==
-
1
);
assertTrue
((
Integer
)
o
==
-
1
);
o
=
rs
.
getObject
(
2
,
Integer
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Integer
);
assertTrue
((
(
Integer
)
o
).
intValue
()
==
-
1
);
assertTrue
((
Integer
)
o
==
-
1
);
assertTrue
(
rs
.
getBoolean
(
"Value"
));
assertTrue
(
rs
.
getByte
(
"Value"
)
==
(
byte
)
-
1
);
assertTrue
(
rs
.
getShort
(
"Value"
)
==
(
short
)
-
1
);
...
...
@@ -816,7 +816,7 @@ public class TestResultSet extends TestDb {
o
=
rs
.
getObject
(
"value"
,
Short
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Short
);
assertTrue
((
(
Short
)
o
).
shortValue
()
==
-
1
);
assertTrue
((
Short
)
o
==
-
1
);
o
=
rs
.
getObject
(
2
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
.
getClass
()
==
(
SysProperties
.
OLD_RESULT_SET_GET_OBJECT
?
Short
.
class
:
Integer
.
class
));
...
...
@@ -824,7 +824,7 @@ public class TestResultSet extends TestDb {
o
=
rs
.
getObject
(
2
,
Short
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Short
);
assertTrue
((
(
Short
)
o
).
shortValue
()
==
-
1
);
assertTrue
((
Short
)
o
==
-
1
);
assertTrue
(
rs
.
getBoolean
(
"Value"
));
assertTrue
(
rs
.
getByte
(
"Value"
)
==
(
byte
)
-
1
);
assertTrue
(
rs
.
getInt
(
"Value"
)
==
-
1
);
...
...
@@ -935,11 +935,11 @@ public class TestResultSet extends TestDb {
o
=
rs
.
getObject
(
"value"
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Long
);
assertTrue
((
(
Long
)
o
).
longValue
()
==
-
1
);
assertTrue
((
Long
)
o
==
-
1
);
o
=
rs
.
getObject
(
"value"
,
Long
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Long
);
assertTrue
((
(
Long
)
o
).
longValue
()
==
-
1
);
assertTrue
((
Long
)
o
==
-
1
);
o
=
rs
.
getObject
(
"value"
,
BigInteger
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
BigInteger
);
...
...
@@ -947,11 +947,11 @@ public class TestResultSet extends TestDb {
o
=
rs
.
getObject
(
2
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Long
);
assertTrue
((
(
Long
)
o
).
longValue
()
==
-
1
);
assertTrue
((
Long
)
o
==
-
1
);
o
=
rs
.
getObject
(
2
,
Long
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
Long
);
assertTrue
((
(
Long
)
o
).
longValue
()
==
-
1
);
assertTrue
((
Long
)
o
==
-
1
);
o
=
rs
.
getObject
(
2
,
BigInteger
.
class
);
trace
(
o
.
getClass
().
getName
());
assertTrue
(
o
instanceof
BigInteger
);
...
...
h2/src/tools/org/h2/dev/hash/MinimalPerfectHash.java
浏览文件 @
297910b0
...
...
@@ -656,7 +656,7 @@ public class MinimalPerfectHash<K> {
if
(
index
==
0
)
{
return
o
.
hashCode
();
}
else
if
(
index
<
8
)
{
long
x
=
o
.
longValue
()
;
long
x
=
o
;
x
+=
index
;
x
=
((
x
>>>
32
)
^
x
)
*
0x45d9f3b
;
x
=
((
x
>>>
32
)
^
x
)
*
0x45d9f3b
;
...
...
@@ -664,7 +664,7 @@ public class MinimalPerfectHash<K> {
}
// get the lower or higher 32 bit depending on the index
int
shift
=
(
index
&
1
)
*
32
;
return
(
int
)
(
o
.
longValue
()
>>>
shift
);
return
(
int
)
(
o
>>>
shift
);
}
}
...
...
h2/src/tools/org/h2/dev/util/FileViewer.java
浏览文件 @
297910b0
...
...
@@ -57,13 +57,13 @@ public class FileViewer extends Tool {
}
else
if
(
arg
.
equals
(
"-find"
))
{
find
=
args
[++
i
];
}
else
if
(
arg
.
equals
(
"-start"
))
{
start
=
Long
.
decode
(
args
[++
i
])
.
longValue
()
;
start
=
Long
.
decode
(
args
[++
i
]);
}
else
if
(
arg
.
equals
(
"-head"
))
{
head
=
true
;
}
else
if
(
arg
.
equals
(
"-tail"
))
{
tail
=
true
;
}
else
if
(
arg
.
equals
(
"-lines"
))
{
lines
=
Integer
.
decode
(
args
[++
i
])
.
intValue
()
;
lines
=
Integer
.
decode
(
args
[++
i
]);
}
else
if
(
arg
.
equals
(
"-quiet"
))
{
quiet
=
true
;
}
else
if
(
arg
.
equals
(
"-help"
)
||
arg
.
equals
(
"-?"
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论