Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
3dc7e038
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3dc7e038
编写于
10月 27, 2008
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6764226: ListTest fails on javap output with bad characters
Reviewed-by: darcy
上级
e5206d1f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
13 deletion
+18
-13
test/tools/javap/ListTest.java
test/tools/javap/ListTest.java
+18
-13
未找到文件。
test/tools/javap/ListTest.java
浏览文件 @
3dc7e038
...
...
@@ -82,16 +82,16 @@ public class ListTest {
String
[]
args
=
new
String
[
options
.
size
()
+
1
];
options
.
toArray
(
args
);
args
[
args
.
length
-
1
]
=
testClassName
;
String
oldOut
=
runOldJavap
(
args
);
String
newOut
=
runNewJavap
(
args
);
boolean
ok
=
oldOut
.
equals
(
newOut
);
byte
[]
oldOut
=
runOldJavap
(
args
);
byte
[]
newOut
=
runNewJavap
(
args
);
boolean
ok
=
equal
(
oldOut
,
newOut
);
System
.
err
.
println
((
ok
?
"pass"
:
"FAIL"
)
+
": "
+
testClassName
);
if
(!
ok
&&
viewResults
)
view
(
oldOut
,
newOut
);
return
ok
;
}
String
runOldJavap
(
String
[]
args
)
{
byte
[]
runOldJavap
(
String
[]
args
)
{
//System.err.println("OLD: " + Arrays.asList(args));
PrintStream
oldOut
=
System
.
out
;
ByteArrayOutputStream
out
=
new
ByteArrayOutputStream
();
...
...
@@ -101,29 +101,34 @@ public class ListTest {
}
finally
{
System
.
setOut
(
oldOut
);
}
return
out
.
to
String
();
return
out
.
to
ByteArray
();
}
String
runNewJavap
(
String
[]
args
)
{
byte
[]
runNewJavap
(
String
[]
args
)
{
String
[]
nArgs
=
new
String
[
args
.
length
+
2
];
nArgs
[
0
]
=
"-XDcompat"
;
nArgs
[
1
]
=
"-XDignore.symbol.file"
;
System
.
arraycopy
(
args
,
0
,
nArgs
,
2
,
args
.
length
);
//System.err.println("NEW: " + Arrays.asList(nArgs));
StringWriter
out
=
new
StringWriter
();
com
.
sun
.
tools
.
javap
.
Main
.
run
(
nArgs
,
new
PrintWriter
(
out
,
true
));
return
out
.
toString
();
ByteArrayOutputStream
out
=
new
ByteArrayOutputStream
();
com
.
sun
.
tools
.
javap
.
Main
.
run
(
nArgs
,
new
PrintWriter
(
new
OutputStreamWriter
(
out
),
true
));
return
out
.
toByteArray
();
}
File
write
(
String
text
,
String
suffix
)
throws
IOException
{
File
f
=
File
.
createTempFile
(
"ListTest"
,
suffix
);
File
Writer
out
=
new
FileWriter
(
f
);
File
write
(
byte
[]
text
,
String
suffix
)
throws
IOException
{
File
f
=
new
File
(
"ListTest."
+
suffix
);
File
OutputStream
out
=
new
FileOutputStream
(
f
);
out
.
write
(
text
);
out
.
close
();
return
f
;
}
void
view
(
String
oldOut
,
String
newOut
)
throws
Exception
{
boolean
equal
(
byte
[]
a1
,
byte
[]
a2
)
{
return
Arrays
.
equals
(
a1
,
a2
);
}
void
view
(
byte
[]
oldOut
,
byte
[]
newOut
)
throws
Exception
{
File
oldFile
=
write
(
oldOut
,
"old"
);
File
newFile
=
write
(
newOut
,
"new"
);
List
<
String
>
cmd
=
new
ArrayList
<
String
>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录