Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
ceb1ba7a
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ceb1ba7a
编写于
10月 11, 2012
作者:
L
lancea
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000763: use XXX.valueOf methods instead of constructors
Reviewed-by: mchung, forax
上级
97d3958f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
12 addition
and
17 deletion
+12
-17
src/share/classes/com/sun/rowset/CachedRowSetImpl.java
src/share/classes/com/sun/rowset/CachedRowSetImpl.java
+4
-9
src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
+3
-3
src/share/classes/javax/sql/rowset/BaseRowSet.java
src/share/classes/javax/sql/rowset/BaseRowSet.java
+3
-3
src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java
src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java
+2
-2
未找到文件。
src/share/classes/com/sun/rowset/CachedRowSetImpl.java
浏览文件 @
ceb1ba7a
/*
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -1746,12 +1746,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
...
@@ -1746,12 +1746,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// convert to a Double and compare to zero
// convert to a Double and compare to zero
try
{
try
{
Double
d
=
new
Double
(
value
.
toString
());
return
Double
.
compare
(
Double
.
parseDouble
(
value
.
toString
()),
0
)
!=
0
;
if
(
d
.
compareTo
(
new
Double
((
double
)
0
))
==
0
)
{
return
false
;
}
else
{
return
true
;
}
}
catch
(
NumberFormatException
ex
)
{
}
catch
(
NumberFormatException
ex
)
{
throw
new
SQLException
(
MessageFormat
.
format
(
resBundle
.
handleGetObject
(
"cachedrowsetimpl.boolfail"
).
toString
(),
throw
new
SQLException
(
MessageFormat
.
format
(
resBundle
.
handleGetObject
(
"cachedrowsetimpl.boolfail"
).
toString
(),
new
Object
[]
{
value
.
toString
().
trim
(),
columnIndex
}));
new
Object
[]
{
value
.
toString
().
trim
(),
columnIndex
}));
...
@@ -4432,7 +4427,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
...
@@ -4432,7 +4427,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// make sure the cursor is on a valid row
// make sure the cursor is on a valid row
checkCursor
();
checkCursor
();
Object
obj
=
convertNumeric
(
new
Float
(
x
),
Object
obj
=
convertNumeric
(
Float
.
valueOf
(
x
),
java
.
sql
.
Types
.
REAL
,
java
.
sql
.
Types
.
REAL
,
RowSetMD
.
getColumnType
(
columnIndex
));
RowSetMD
.
getColumnType
(
columnIndex
));
...
@@ -4467,7 +4462,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
...
@@ -4467,7 +4462,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
checkIndex
(
columnIndex
);
checkIndex
(
columnIndex
);
// make sure the cursor is on a valid row
// make sure the cursor is on a valid row
checkCursor
();
checkCursor
();
Object
obj
=
convertNumeric
(
new
Double
(
x
),
Object
obj
=
convertNumeric
(
Double
.
valueOf
(
x
),
java
.
sql
.
Types
.
DOUBLE
,
java
.
sql
.
Types
.
DOUBLE
,
RowSetMD
.
getColumnType
(
columnIndex
));
RowSetMD
.
getColumnType
(
columnIndex
));
...
...
src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
浏览文件 @
ceb1ba7a
/*
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -839,7 +839,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
...
@@ -839,7 +839,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
if
(
onInsertRow
)
{
if
(
onInsertRow
)
{
if
(
p
!=
null
)
{
if
(
p
!=
null
)
{
bool
=
p
.
evaluate
(
new
Float
(
x
)
,
columnIndex
);
bool
=
p
.
evaluate
(
Float
.
valueOf
(
x
)
,
columnIndex
);
if
(!
bool
)
{
if
(!
bool
)
{
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"filteredrowsetimpl.notallowed"
).
toString
());
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"filteredrowsetimpl.notallowed"
).
toString
());
...
@@ -906,7 +906,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
...
@@ -906,7 +906,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
if
(
onInsertRow
)
{
if
(
onInsertRow
)
{
if
(
p
!=
null
)
{
if
(
p
!=
null
)
{
bool
=
p
.
evaluate
(
new
Double
(
x
)
,
columnIndex
);
bool
=
p
.
evaluate
(
Double
.
valueOf
(
x
)
,
columnIndex
);
if
(!
bool
)
{
if
(!
bool
)
{
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"filteredrowsetimpl.notallowed"
).
toString
());
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"filteredrowsetimpl.notallowed"
).
toString
());
...
...
src/share/classes/javax/sql/rowset/BaseRowSet.java
浏览文件 @
ceb1ba7a
/*
/*
* Copyright (c) 2003, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
2
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -1850,7 +1850,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
...
@@ -1850,7 +1850,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
if
(
params
==
null
){
if
(
params
==
null
){
throw
new
SQLException
(
"Set initParams() before setFloat"
);
throw
new
SQLException
(
"Set initParams() before setFloat"
);
}
}
params
.
put
(
Integer
.
valueOf
(
parameterIndex
-
1
),
new
Float
(
x
));
params
.
put
(
Integer
.
valueOf
(
parameterIndex
-
1
),
Float
.
valueOf
(
x
));
}
}
/**
/**
...
@@ -1882,7 +1882,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
...
@@ -1882,7 +1882,7 @@ public abstract class BaseRowSet implements Serializable, Cloneable {
if
(
params
==
null
){
if
(
params
==
null
){
throw
new
SQLException
(
"Set initParams() before setDouble"
);
throw
new
SQLException
(
"Set initParams() before setDouble"
);
}
}
params
.
put
(
Integer
.
valueOf
(
parameterIndex
-
1
),
new
Double
(
x
));
params
.
put
(
Integer
.
valueOf
(
parameterIndex
-
1
),
Double
.
valueOf
(
x
));
}
}
/**
/**
...
...
src/share/classes/javax/sql/rowset/serial/SQLOutputImpl.java
浏览文件 @
ceb1ba7a
...
@@ -215,7 +215,7 @@ public class SQLOutputImpl implements SQLOutput {
...
@@ -215,7 +215,7 @@ public class SQLOutputImpl implements SQLOutput {
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
void
writeFloat
(
float
x
)
throws
SQLException
{
public
void
writeFloat
(
float
x
)
throws
SQLException
{
attribs
.
add
(
new
Float
(
x
));
attribs
.
add
(
Float
.
valueOf
(
x
));
}
}
/**
/**
...
@@ -230,7 +230,7 @@ public class SQLOutputImpl implements SQLOutput {
...
@@ -230,7 +230,7 @@ public class SQLOutputImpl implements SQLOutput {
*/
*/
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
public
void
writeDouble
(
double
x
)
throws
SQLException
{
public
void
writeDouble
(
double
x
)
throws
SQLException
{
attribs
.
add
(
new
Double
(
x
));
attribs
.
add
(
Double
.
valueOf
(
x
));
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录