Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
1b55cb24
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
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看板
提交
1b55cb24
编写于
7月 24, 2009
作者:
S
sherman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
5063507: (fmt) missing exception for "%#s" format specifier
Summary: throw appropriate exception when necessary Reviewed-by: alanb
上级
ee04cdf5
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
88 addition
and
5 deletion
+88
-5
src/share/classes/java/util/Formatter.java
src/share/classes/java/util/Formatter.java
+7
-4
test/java/util/Formatter/Basic-X.java
test/java/util/Formatter/Basic-X.java
+4
-0
test/java/util/Formatter/Basic.java
test/java/util/Formatter/Basic.java
+1
-1
test/java/util/Formatter/BasicBigDecimal.java
test/java/util/Formatter/BasicBigDecimal.java
+4
-0
test/java/util/Formatter/BasicBigInteger.java
test/java/util/Formatter/BasicBigInteger.java
+4
-0
test/java/util/Formatter/BasicBoolean.java
test/java/util/Formatter/BasicBoolean.java
+4
-0
test/java/util/Formatter/BasicBooleanObject.java
test/java/util/Formatter/BasicBooleanObject.java
+4
-0
test/java/util/Formatter/BasicByte.java
test/java/util/Formatter/BasicByte.java
+4
-0
test/java/util/Formatter/BasicByteObject.java
test/java/util/Formatter/BasicByteObject.java
+4
-0
test/java/util/Formatter/BasicChar.java
test/java/util/Formatter/BasicChar.java
+4
-0
test/java/util/Formatter/BasicCharObject.java
test/java/util/Formatter/BasicCharObject.java
+4
-0
test/java/util/Formatter/BasicDateTime.java
test/java/util/Formatter/BasicDateTime.java
+4
-0
test/java/util/Formatter/BasicDouble.java
test/java/util/Formatter/BasicDouble.java
+4
-0
test/java/util/Formatter/BasicDoubleObject.java
test/java/util/Formatter/BasicDoubleObject.java
+4
-0
test/java/util/Formatter/BasicFloat.java
test/java/util/Formatter/BasicFloat.java
+4
-0
test/java/util/Formatter/BasicFloatObject.java
test/java/util/Formatter/BasicFloatObject.java
+4
-0
test/java/util/Formatter/BasicInt.java
test/java/util/Formatter/BasicInt.java
+4
-0
test/java/util/Formatter/BasicIntObject.java
test/java/util/Formatter/BasicIntObject.java
+4
-0
test/java/util/Formatter/BasicLong.java
test/java/util/Formatter/BasicLong.java
+4
-0
test/java/util/Formatter/BasicLongObject.java
test/java/util/Formatter/BasicLongObject.java
+4
-0
test/java/util/Formatter/BasicShort.java
test/java/util/Formatter/BasicShort.java
+4
-0
test/java/util/Formatter/BasicShortObject.java
test/java/util/Formatter/BasicShortObject.java
+4
-0
未找到文件。
src/share/classes/java/util/Formatter.java
浏览文件 @
1b55cb24
...
...
@@ -2818,15 +2818,18 @@ public final class Formatter implements Closeable, Flushable {
}
private
void
printString
(
Object
arg
,
Locale
l
)
throws
IOException
{
if
(
arg
==
null
)
{
print
(
"null"
);
}
else
if
(
arg
instanceof
Formattable
)
{
if
(
arg
instanceof
Formattable
)
{
Formatter
fmt
=
formatter
;
if
(
formatter
.
locale
()
!=
l
)
fmt
=
new
Formatter
(
formatter
.
out
(),
l
);
((
Formattable
)
arg
).
formatTo
(
fmt
,
f
.
valueOf
(),
width
,
precision
);
}
else
{
print
(
arg
.
toString
());
if
(
f
.
contains
(
Flags
.
ALTERNATE
))
failMismatch
(
Flags
.
ALTERNATE
,
's'
);
if
(
arg
==
null
)
print
(
"null"
);
else
print
(
arg
.
toString
());
}
}
...
...
test/java/util/Formatter/Basic-X.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class Basic$Type$ extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/Basic.java
浏览文件 @
1b55cb24
...
...
@@ -25,7 +25,7 @@
* @summary Unit test for formatter
* @bug 4906370 4962433 4973103 4989961 5005818 5031150 4970931 4989491 5002937
* 5005104 5007745 5061412 5055180 5066788 5088703 6317248 6318369 6320122
* 6344623 6369500 6534606 6282094 6286592 6476425
* 6344623 6369500 6534606 6282094 6286592 6476425
5063507
*
* @run shell/timeout=240 Basic.sh
*/
...
...
test/java/util/Formatter/BasicBigDecimal.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicBigDecimal extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicBigInteger.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicBigInteger extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicBoolean.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicBoolean extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicBooleanObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicBooleanObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicByte.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicByte extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicByteObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicByteObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicChar.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicChar extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicCharObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicCharObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicDateTime.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicDateTime extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicDouble.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicDouble extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicDoubleObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicDoubleObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicFloat.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicFloat extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicFloatObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicFloatObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicInt.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicInt extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicIntObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicIntObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicLong.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicLong extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicLongObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicLongObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicShort.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicShort extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
test/java/util/Formatter/BasicShortObject.java
浏览文件 @
1b55cb24
...
...
@@ -486,6 +486,10 @@ public class BasicShortObject extends Basic {
//---------------------------------------------------------------------
tryCatch
(
"%-s"
,
MissingFormatWidthException
.
class
);
tryCatch
(
"%--s"
,
DuplicateFormatFlagsException
.
class
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
0.5f
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
"hello"
);
tryCatch
(
"%#s"
,
FormatFlagsConversionMismatchException
.
class
,
null
);
//---------------------------------------------------------------------
// %h
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录