Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
92de547e
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
92de547e
编写于
10月 01, 2010
作者:
L
lancea
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6988993: Address Findbugs warnings for the use of String Constructor
Reviewed-by: ohair
上级
fcd7809a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
56 addition
and
61 deletion
+56
-61
jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
+3
-3
jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
+1
-1
jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java
jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java
+2
-4
jdk/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java
...e/classes/com/sun/rowset/internal/CachedRowSetWriter.java
+2
-2
jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
...e/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
+1
-1
jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java
...sses/com/sun/rowset/internal/XmlReaderContentHandler.java
+6
-6
jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
+7
-7
jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
...rc/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
+28
-31
jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java
jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java
+2
-2
jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
...c/share/classes/javax/sql/rowset/serial/SerialStruct.java
+4
-4
未找到文件。
jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
浏览文件 @
92de547e
...
...
@@ -4042,7 +4042,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
case
java
.
sql
.
Types
.
CHAR
:
case
java
.
sql
.
Types
.
VARCHAR
:
case
java
.
sql
.
Types
.
LONGVARCHAR
:
return
new
String
(
srcObj
.
toString
()
);
return
srcObj
.
toString
(
);
default
:
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"cachedrowsetimpl.dtypemismt"
).
toString
()+
trgType
);
}
...
...
@@ -4139,7 +4139,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
case
java
.
sql
.
Types
.
CHAR
:
case
java
.
sql
.
Types
.
VARCHAR
:
case
java
.
sql
.
Types
.
LONGVARCHAR
:
return
new
String
(
srcObj
.
toString
()
);
return
srcObj
.
toString
(
);
default
:
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"cachedrowsetimpl.dtypemismt"
).
toString
());
}
...
...
@@ -6434,7 +6434,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
if
(
tabName
==
null
)
throw
new
SQLException
(
resBundle
.
handleGetObject
(
"cachedrowsetimpl.tablename"
).
toString
());
else
tableName
=
new
String
(
tabName
)
;
tableName
=
tabName
;
}
/**
...
...
jdk/src/share/classes/com/sun/rowset/FilteredRowSetImpl.java
浏览文件 @
92de547e
...
...
@@ -1106,7 +1106,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
public
void
updateBytes
(
int
columnIndex
,
byte
[]
x
)
throws
SQLException
{
boolean
bool
;
String
val
=
new
String
()
;
String
val
=
""
;
Byte
[]
obj_arr
=
new
Byte
[
x
.
length
];
...
...
jdk/src/share/classes/com/sun/rowset/JoinRowSetImpl.java
浏览文件 @
92de547e
...
...
@@ -876,8 +876,8 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
String
strWhereClause
=
"Select "
;
String
whereClause
;
String
tabName
=
null
;
String
strTabName
=
null
;
String
tabName
=
""
;
String
strTabName
=
""
;
int
sz
,
cols
;
int
j
;
CachedRowSetImpl
crs
;
...
...
@@ -891,8 +891,6 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
// tableNameX.(rowsetX.getMatchColumnName()) ==
// tableNameZ.(rowsetZ.getMatchColumnName()));
tabName
=
new
String
();
strTabName
=
new
String
();
sz
=
vecRowSetsInJOIN
.
size
();
for
(
int
i
=
0
;
i
<
sz
;
i
++)
{
crs
=
(
CachedRowSetImpl
)
vecRowSetsInJOIN
.
get
(
i
);
...
...
jdk/src/share/classes/com/sun/rowset/internal/CachedRowSetWriter.java
浏览文件 @
92de547e
...
...
@@ -541,7 +541,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// how many fields need to be updated
int
colsNotChanged
=
0
;
Vector
cols
=
new
Vector
();
String
updateExec
=
new
String
(
updateCmd
)
;
String
updateExec
=
updateCmd
;
Object
orig
;
Object
curr
;
Object
rsval
;
...
...
@@ -1184,7 +1184,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// trim all the leading and trailing whitespaces,
// white spaces can never be catalog, schema or a table name.
String
cmd
=
new
String
()
;
String
cmd
=
""
;
catalog
=
catalog
.
trim
();
schema
=
schema
.
trim
();
...
...
jdk/src/share/classes/com/sun/rowset/internal/WebRowSetXmlWriter.java
浏览文件 @
92de547e
...
...
@@ -641,7 +641,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
return
null
;
}
char
[]
charStr
=
s
.
toCharArray
();
String
specialStr
=
new
String
()
;
String
specialStr
=
""
;
for
(
int
i
=
0
;
i
<
charStr
.
length
;
i
++)
{
if
(
charStr
[
i
]
==
'&'
)
{
...
...
jdk/src/share/classes/com/sun/rowset/internal/XmlReaderContentHandler.java
浏览文件 @
92de547e
...
...
@@ -441,9 +441,9 @@ public class XmlReaderContentHandler extends DefaultHandler {
updates
=
new
Vector
();
// start out with the empty string
columnValue
=
new
String
(
""
)
;
propertyValue
=
new
String
(
""
)
;
metaDataValue
=
new
String
(
""
)
;
columnValue
=
""
;
propertyValue
=
""
;
metaDataValue
=
""
;
nullVal
=
false
;
idx
=
0
;
...
...
@@ -686,7 +686,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
}
// propertyValue need to be reset to an empty string
propertyValue
=
new
String
(
""
)
;
propertyValue
=
""
;
setTag
(-
1
);
break
;
case
METADATA:
...
...
@@ -710,7 +710,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
}
// metaDataValue needs to be reset to an empty string
metaDataValue
=
new
String
(
""
)
;
metaDataValue
=
""
;
}
setTag
(-
1
);
break
;
...
...
@@ -736,7 +736,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
insertValue
(
tempStr
);
}
// columnValue now need to be reset to the empty string
columnValue
=
new
String
(
""
)
;
columnValue
=
""
;
}
catch
(
SQLException
ex
)
{
throw
new
SAXException
(
MessageFormat
.
format
(
resBundle
.
handleGetObject
(
"xmlrch.errinsert"
).
toString
(),
ex
.
getMessage
()));
}
...
...
jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
浏览文件 @
92de547e
/*
* Copyright (c) 2003, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -734,7 +734,7 @@ public static final int ASCII_STREAM_PARAM = 2;
throw
new
SQLException
(
"Set initParams() before setCommand"
);
}
params
.
clear
();
command
=
new
String
(
cmd
)
;
command
=
cmd
;
}
}
...
...
@@ -797,7 +797,7 @@ public static final int ASCII_STREAM_PARAM = 2;
throw
new
SQLException
(
"Invalid url string detected. "
+
"Cannot be of length less than 1"
);
}
else
{
URL
=
new
String
(
url
)
;
URL
=
url
;
}
dataSource
=
null
;
...
...
@@ -854,7 +854,7 @@ public static final int ASCII_STREAM_PARAM = 2;
}
else
if
(
name
.
equals
(
""
))
{
throw
new
SQLException
(
"DataSource name cannot be empty string"
);
}
else
{
dataSource
=
n
ew
String
(
name
)
;
dataSource
=
n
ame
;
}
URL
=
null
;
...
...
@@ -889,7 +889,7 @@ public static final int ASCII_STREAM_PARAM = 2;
{
username
=
null
;
}
else
{
username
=
n
ew
String
(
name
)
;
username
=
n
ame
;
}
}
...
...
@@ -924,7 +924,7 @@ public static final int ASCII_STREAM_PARAM = 2;
{
password
=
null
;
}
else
{
password
=
new
String
(
pass
)
;
password
=
pass
;
}
}
...
...
@@ -1645,7 +1645,7 @@ public static final int ASCII_STREAM_PARAM = 2;
nullVal
=
new
Object
[
3
];
nullVal
[
0
]
=
null
;
nullVal
[
1
]
=
new
Integer
(
sqlType
);
nullVal
[
2
]
=
new
String
(
typeName
)
;
nullVal
[
2
]
=
typeName
;
if
(
params
==
null
){
throw
new
SQLException
(
"Set initParams() before setNull"
);
...
...
jdk/src/share/classes/javax/sql/rowset/RowSetMetaDataImpl.java
浏览文件 @
92de547e
/*
* Copyright (c) 2003, 20
06
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -306,9 +306,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public
void
setColumnLabel
(
int
columnIndex
,
String
label
)
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
label
!=
null
)
{
colInfo
[
columnIndex
].
columnLabel
=
new
String
(
label
)
;
colInfo
[
columnIndex
].
columnLabel
=
label
;
}
else
{
colInfo
[
columnIndex
].
columnLabel
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
columnLabel
=
""
;
}
}
...
...
@@ -326,9 +326,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public
void
setColumnName
(
int
columnIndex
,
String
columnName
)
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
columnName
!=
null
)
{
colInfo
[
columnIndex
].
columnName
=
new
String
(
columnName
)
;
colInfo
[
columnIndex
].
columnName
=
columnName
;
}
else
{
colInfo
[
columnIndex
].
columnName
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
columnName
=
""
;
}
}
...
...
@@ -348,9 +348,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public
void
setSchemaName
(
int
columnIndex
,
String
schemaName
)
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
schemaName
!=
null
)
{
colInfo
[
columnIndex
].
schemaName
=
new
String
(
schemaName
)
;
colInfo
[
columnIndex
].
schemaName
=
schemaName
;
}
else
{
colInfo
[
columnIndex
].
schemaName
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
schemaName
=
""
;
}
}
...
...
@@ -411,9 +411,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public
void
setTableName
(
int
columnIndex
,
String
tableName
)
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
tableName
!=
null
)
{
colInfo
[
columnIndex
].
tableName
=
new
String
(
tableName
)
;
colInfo
[
columnIndex
].
tableName
=
tableName
;
}
else
{
colInfo
[
columnIndex
].
tableName
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
tableName
=
""
;
}
}
...
...
@@ -432,9 +432,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
public
void
setCatalogName
(
int
columnIndex
,
String
catalogName
)
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
catalogName
!=
null
)
colInfo
[
columnIndex
].
catName
=
new
String
(
catalogName
)
;
colInfo
[
columnIndex
].
catName
=
catalogName
;
else
colInfo
[
columnIndex
].
catName
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
catName
=
""
;
}
/**
...
...
@@ -474,9 +474,9 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
throws
SQLException
{
checkColRange
(
columnIndex
);
if
(
typeName
!=
null
)
{
colInfo
[
columnIndex
].
colTypeName
=
new
String
(
typeName
)
;
colInfo
[
columnIndex
].
colTypeName
=
typeName
;
}
else
{
colInfo
[
columnIndex
].
colTypeName
=
new
String
(
""
)
;
colInfo
[
columnIndex
].
colTypeName
=
""
;
}
}
...
...
@@ -827,7 +827,7 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
* or the given column number is out of bounds
*/
public
String
getColumnClassName
(
int
columnIndex
)
throws
SQLException
{
String
className
=
(
new
String
()).
getClass
()
.
getName
();
String
className
=
String
.
class
.
getName
();
int
sqlType
=
getColumnType
(
columnIndex
);
...
...
@@ -835,65 +835,62 @@ public class RowSetMetaDataImpl implements RowSetMetaData, Serializable {
case
Types
.
NUMERIC
:
case
Types
.
DECIMAL
:
className
=
(
new
java
.
math
.
BigDecimal
(
0
)).
getClass
().
getName
();
className
=
java
.
math
.
BigDecimal
.
class
.
getName
();
break
;
case
Types
.
BIT
:
className
=
(
new
Boolean
(
false
)).
getClass
().
getName
();
className
=
java
.
lang
.
Boolean
.
class
.
getName
();
break
;
case
Types
.
TINYINT
:
className
=
(
new
Byte
(
"0"
)).
getClass
().
getName
();
className
=
java
.
lang
.
Byte
.
class
.
getName
();
break
;
case
Types
.
SMALLINT
:
className
=
(
new
Short
(
"0"
)).
getClass
().
getName
();
className
=
java
.
lang
.
Short
.
class
.
getName
();
break
;
case
Types
.
INTEGER
:
className
=
(
new
Integer
(
0
)).
getClass
().
getName
();
className
=
java
.
lang
.
Integer
.
class
.
getName
();
break
;
case
Types
.
BIGINT
:
className
=
(
new
Long
(
0
)).
getClass
().
getName
();
className
=
java
.
lang
.
Long
.
class
.
getName
();
break
;
case
Types
.
REAL
:
className
=
(
new
Float
(
0
)).
getClass
().
getName
();
className
=
java
.
lang
.
Float
.
class
.
getName
();
break
;
case
Types
.
FLOAT
:
case
Types
.
DOUBLE
:
className
=
(
new
Double
(
0
)).
getClass
()
.
getName
();
className
=
java
.
lang
.
Double
.
class
.
getName
();
break
;
case
Types
.
BINARY
:
case
Types
.
VARBINARY
:
case
Types
.
LONGVARBINARY
:
byte
[]
b
=
{};
className
=
(
b
.
getClass
()).
getName
();
className
=
"byte[]"
;
break
;
case
Types
.
DATE
:
className
=
(
new
java
.
sql
.
Date
(
123456
)).
getClass
().
getName
();
className
=
java
.
sql
.
Date
.
class
.
getName
();
break
;
case
Types
.
TIME
:
className
=
(
new
java
.
sql
.
Time
(
123456
)).
getClass
().
getName
();
className
=
java
.
sql
.
Time
.
class
.
getName
();
break
;
case
Types
.
TIMESTAMP
:
className
=
(
new
java
.
sql
.
Timestamp
(
123456
)).
getClass
().
getName
();
className
=
java
.
sql
.
Timestamp
.
class
.
getName
();
break
;
case
Types
.
BLOB
:
byte
[]
blob
=
{};
className
=
(
blob
.
getClass
()).
getName
();
className
=
java
.
sql
.
Blob
.
class
.
getName
();
break
;
case
Types
.
CLOB
:
char
[]
c
=
{};
className
=
(
c
.
getClass
()).
getName
();
className
=
java
.
sql
.
Clob
.
class
.
getName
();
break
;
}
...
...
jdk/src/share/classes/javax/sql/rowset/serial/SerialRef.java
浏览文件 @
92de547e
/*
* Copyright (c) 2003, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -77,7 +77,7 @@ public class SerialRef implements Ref, Serializable, Cloneable {
throw
new
SQLException
(
"Cannot instantiate a SerialRef object "
+
"that returns a null base type name"
);
}
else
{
baseTypeName
=
new
String
(
ref
.
getBaseTypeName
()
);
baseTypeName
=
ref
.
getBaseTypeName
(
);
}
}
...
...
jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
浏览文件 @
92de547e
/*
* Copyright (c) 2003, 20
04
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 20
10
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -94,7 +94,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
try
{
// get the type name
SQLTypeName
=
new
String
(
in
.
getSQLTypeName
()
);
SQLTypeName
=
in
.
getSQLTypeName
(
);
System
.
out
.
println
(
"SQLTypeName: "
+
SQLTypeName
);
// get the attributes of the struct
...
...
@@ -137,7 +137,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
try
{
//set the type name
SQLTypeName
=
new
String
(
in
.
getSQLTypeName
()
);
SQLTypeName
=
in
.
getSQLTypeName
(
);
Vector
tmp
=
new
Vector
();
in
.
writeSQL
(
new
SQLOutputImpl
(
tmp
,
map
));
...
...
@@ -247,7 +247,7 @@ public class SerialStruct implements Struct, Serializable, Cloneable {
}
/**
* The identifier that assists in the serialization of this
* The identifier that assists in the serialization of this
* <code>SerialStruct</code> object.
*/
static
final
long
serialVersionUID
=
-
8322445504027483372L
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录