Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
cc99a464
提交
cc99a464
authored
10月 30, 2012
作者:
noelgrandin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avoid instantiating Boolean objects, rather use the predefined values in java.lang.Boolean
上级
9686ba35
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
4 行增加
和
4 行删除
+4
-4
SupportedTypes.java
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
+1
-1
TestPreparedStatement.java
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
+2
-2
ClassUtils.java
h2/src/tools/org/h2/jaqu/util/ClassUtils.java
+1
-1
没有找到文件。
h2/src/test/org/h2/test/jaqu/SupportedTypes.java
浏览文件 @
cc99a464
...
@@ -75,7 +75,7 @@ public class SupportedTypes {
...
@@ -75,7 +75,7 @@ public class SupportedTypes {
static
SupportedTypes
randomValue
()
{
static
SupportedTypes
randomValue
()
{
Random
rand
=
new
Random
();
Random
rand
=
new
Random
();
SupportedTypes
s
=
new
SupportedTypes
();
SupportedTypes
s
=
new
SupportedTypes
();
s
.
myBool
=
new
Boolean
(
rand
.
nextBoolean
());
s
.
myBool
=
Boolean
.
valueOf
(
rand
.
nextBoolean
());
s
.
myByte
=
new
Byte
((
byte
)
rand
.
nextInt
(
Byte
.
MAX_VALUE
));
s
.
myByte
=
new
Byte
((
byte
)
rand
.
nextInt
(
Byte
.
MAX_VALUE
));
s
.
myShort
=
new
Short
((
short
)
rand
.
nextInt
(
Short
.
MAX_VALUE
));
s
.
myShort
=
new
Short
((
short
)
rand
.
nextInt
(
Short
.
MAX_VALUE
));
s
.
myInteger
=
new
Integer
(
rand
.
nextInt
());
s
.
myInteger
=
new
Integer
(
rand
.
nextInt
());
...
...
h2/src/test/org/h2/test/jdbc/TestPreparedStatement.java
浏览文件 @
cc99a464
...
@@ -906,7 +906,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -906,7 +906,7 @@ public class TestPreparedStatement extends TestBase {
stat
.
execute
(
"INSERT INTO TEST VALUES(1, 'Hello')"
);
stat
.
execute
(
"INSERT INTO TEST VALUES(1, 'Hello')"
);
PreparedStatement
prep
=
conn
PreparedStatement
prep
=
conn
.
prepareStatement
(
"SELECT ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? FROM TEST"
);
.
prepareStatement
(
"SELECT ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? FROM TEST"
);
prep
.
setObject
(
1
,
new
Boolean
(
true
)
);
prep
.
setObject
(
1
,
Boolean
.
TRUE
);
prep
.
setObject
(
2
,
"Abc"
);
prep
.
setObject
(
2
,
"Abc"
);
prep
.
setObject
(
3
,
new
BigDecimal
(
"10.2"
));
prep
.
setObject
(
3
,
new
BigDecimal
(
"10.2"
));
prep
.
setObject
(
4
,
new
Byte
((
byte
)
0xff
));
prep
.
setObject
(
4
,
new
Byte
((
byte
)
0xff
));
...
@@ -929,7 +929,7 @@ public class TestPreparedStatement extends TestBase {
...
@@ -929,7 +929,7 @@ public class TestPreparedStatement extends TestBase {
prep
.
setObject
(
20
,
new
java
.
math
.
BigInteger
(
"12345"
),
Types
.
OTHER
);
prep
.
setObject
(
20
,
new
java
.
math
.
BigInteger
(
"12345"
),
Types
.
OTHER
);
rs
=
prep
.
executeQuery
();
rs
=
prep
.
executeQuery
();
rs
.
next
();
rs
.
next
();
assertTrue
(
rs
.
getObject
(
1
).
equals
(
new
Boolean
(
true
)
));
assertTrue
(
rs
.
getObject
(
1
).
equals
(
Boolean
.
TRUE
));
assertTrue
(
rs
.
getObject
(
2
).
equals
(
"Abc"
));
assertTrue
(
rs
.
getObject
(
2
).
equals
(
"Abc"
));
assertTrue
(
rs
.
getObject
(
3
).
equals
(
new
BigDecimal
(
"10.2"
)));
assertTrue
(
rs
.
getObject
(
3
).
equals
(
new
BigDecimal
(
"10.2"
)));
assertTrue
(
rs
.
getObject
(
4
).
equals
((
byte
)
0xff
));
assertTrue
(
rs
.
getObject
(
4
).
equals
((
byte
)
0xff
));
...
...
h2/src/tools/org/h2/jaqu/util/ClassUtils.java
浏览文件 @
cc99a464
...
@@ -48,7 +48,7 @@ public class ClassUtils {
...
@@ -48,7 +48,7 @@ public class ClassUtils {
}
else
if
(
clazz
==
Double
.
class
)
{
}
else
if
(
clazz
==
Double
.
class
)
{
return
(
T
)
new
Double
(
COUNTER
.
getAndIncrement
());
return
(
T
)
new
Double
(
COUNTER
.
getAndIncrement
());
}
else
if
(
clazz
==
Boolean
.
class
)
{
}
else
if
(
clazz
==
Boolean
.
class
)
{
return
(
T
)
new
Boolean
(
false
)
;
return
(
T
)
Boolean
.
FALSE
;
}
else
if
(
clazz
==
BigDecimal
.
class
)
{
}
else
if
(
clazz
==
BigDecimal
.
class
)
{
return
(
T
)
new
BigDecimal
(
COUNTER
.
getAndIncrement
());
return
(
T
)
new
BigDecimal
(
COUNTER
.
getAndIncrement
());
}
else
if
(
clazz
==
BigInteger
.
class
)
{
}
else
if
(
clazz
==
BigInteger
.
class
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论