Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
36b0934e
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看板
提交
36b0934e
编写于
9月 16, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6985115: tests create too much output
Reviewed-by: mcimadamore
上级
d0bbb444
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
53 addition
and
35 deletion
+53
-35
test/tools/javac/T6855236.java
test/tools/javac/T6855236.java
+12
-6
test/tools/javac/failover/CheckAttributedTree.java
test/tools/javac/failover/CheckAttributedTree.java
+2
-2
test/tools/javac/tree/AbstractTreeScannerTest.java
test/tools/javac/tree/AbstractTreeScannerTest.java
+11
-1
test/tools/javac/tree/JavacTreeScannerTest.java
test/tools/javac/tree/JavacTreeScannerTest.java
+7
-6
test/tools/javac/tree/SourceTreeScannerTest.java
test/tools/javac/tree/SourceTreeScannerTest.java
+7
-6
test/tools/javap/T6868539.java
test/tools/javap/T6868539.java
+13
-13
test/tools/javap/T6980017.java
test/tools/javap/T6980017.java
+1
-1
未找到文件。
test/tools/javac/T6855236.java
浏览文件 @
36b0934e
...
...
@@ -71,12 +71,10 @@ public class T6855236 extends AbstractProcessor {
@Override
public
Object
visitMethodInvocation
(
MethodInvocationTree
node
,
Trees
p
)
{
System
.
out
.
print
(
"current path: "
);
System
.
out
.
print
ln
(
"current path: "
);
for
(
Tree
t
:
getCurrentPath
())
{
System
.
out
.
print
(
'/'
);
System
.
out
.
print
(
t
);
}
System
.
out
.
println
();
System
.
out
.
println
(
" "
+
t
.
getKind
()
+
": "
+
trim
(
t
,
64
));
}
System
.
out
.
println
(
"parent path: "
+
getCurrentPath
().
getParentPath
());
System
.
out
.
println
(
"method select: "
+
node
.
getMethodSelect
().
toString
());
for
(
ExpressionTree
arg
:
node
.
getArguments
())
{
...
...
@@ -88,12 +86,20 @@ public class T6855236 extends AbstractProcessor {
@Override
public
Object
visitExpressionStatement
(
ExpressionStatementTree
node
,
Trees
p
)
{
ExpressionTree
t
=
node
.
getExpression
();
System
.
out
.
println
(
"expression statement: "
+
t
.
toString
());
System
.
out
.
println
();
System
.
out
.
println
(
"expression statement: "
+
trim
(
t
,
64
));
return
super
.
visitExpressionStatement
(
node
,
p
);
}
}
private
String
trim
(
Tree
t
,
int
len
)
{
String
s
=
t
.
toString
().
trim
().
replaceAll
(
"\\s+"
,
" "
);
if
(
s
.
length
()
>
len
)
s
=
s
.
substring
(
0
,
len
)
+
"..."
;
return
s
;
}
}
test/tools/javac/failover/CheckAttributedTree.java
浏览文件 @
36b0934e
...
...
@@ -282,13 +282,13 @@ public class CheckAttributedTree {
Iterable
<?
extends
CompilationUnitTree
>
trees
=
task
.
parse
();
task
.
analyze
();
List
<
Pair
<
JCCompilationUnit
,
JCTree
>>
res
=
new
ArrayList
<>();
System
.
out
.
println
(
"Try to add pairs. Elems are "
+
analyzedElems
);
//
System.out.println("Try to add pairs. Elems are " + analyzedElems);
for
(
CompilationUnitTree
t
:
trees
)
{
JCCompilationUnit
cu
=
(
JCCompilationUnit
)
t
;
for
(
JCTree
def
:
cu
.
defs
)
{
if
(
def
.
getTag
()
==
JCTree
.
CLASSDEF
&&
analyzedElems
.
contains
(((
JCTree
.
JCClassDecl
)
def
).
sym
))
{
System
.
out
.
println
(
"Adding pair..."
);
//
System.out.println("Adding pair...");
res
.
add
(
new
Pair
<>(
cu
,
def
));
}
}
...
...
test/tools/javac/tree/AbstractTreeScannerTest.java
浏览文件 @
36b0934e
...
...
@@ -181,6 +181,16 @@ public abstract class AbstractTreeScannerTest {
errors
++;
}
/**
* Report an error. When the program is complete, the program will either
* exit or throw an Error if any errors have been reported.
* @param msg the error message
*/
void
error
(
JavaFileObject
file
,
String
msg
)
{
System
.
err
.
println
(
file
.
getName
()
+
": "
+
msg
);
errors
++;
}
/**
* Report an error for a specific tree node.
* @param file the source file for the tree
...
...
@@ -197,7 +207,7 @@ public abstract class AbstractTreeScannerTest {
*/
String
trim
(
Tree
tree
,
int
len
)
{
JCTree
t
=
(
JCTree
)
tree
;
String
s
=
t
.
toString
().
replaceAll
(
"
[\r\n]+"
,
" "
).
replaceAll
(
"
+"
,
" "
);
String
s
=
t
.
toString
().
replaceAll
(
"
\\s
+"
,
" "
);
return
(
s
.
length
()
<
len
)
?
s
:
s
.
substring
(
0
,
len
);
}
...
...
test/tools/javac/tree/JavacTreeScannerTest.java
浏览文件 @
36b0934e
...
...
@@ -89,12 +89,13 @@ public class JavacTreeScannerTest extends AbstractTreeScannerTest {
scan
(
tree
);
expect
=
new
HashSet
<
JCTree
>();
reflectiveScan
(
tree
);
if
(
found
.
equals
(
expect
))
{
System
.
err
.
println
(
found
.
size
()
+
"
trees compared OK"
);
//System.err.println(sourcefile.getName() + ":
trees compared OK");
return
found
.
size
();
}
error
(
"Differences found for "
+
tree
.
sourcefile
.
getName
()
);
error
(
sourcefile
,
"differences found"
);
if
(
found
.
size
()
!=
expect
.
size
())
error
(
"Size mismatch; found: "
+
found
.
size
()
+
", expected: "
+
expect
.
size
());
...
...
@@ -103,13 +104,13 @@ public class JavacTreeScannerTest extends AbstractTreeScannerTest {
missing
.
addAll
(
expect
);
missing
.
removeAll
(
found
);
for
(
JCTree
t:
missing
)
error
(
tree
.
sourcefile
,
t
,
"missing"
);
error
(
sourcefile
,
t
,
"missing"
);
Set
<
JCTree
>
excess
=
new
HashSet
<
JCTree
>();
excess
.
addAll
(
found
);
excess
.
removeAll
(
expect
);
for
(
JCTree
t:
excess
)
error
(
tree
.
sourcefile
,
t
,
"unexpected"
);
error
(
sourcefile
,
t
,
"unexpected"
);
return
0
;
}
...
...
@@ -119,7 +120,7 @@ public class JavacTreeScannerTest extends AbstractTreeScannerTest {
public
void
scan
(
JCTree
tree
)
{
if
(
tree
==
null
)
return
;
System
.
err
.
println
(
"FOUND: "
+
tree
.
getTag
()
+
" "
+
trim
(
tree
,
64
));
//
System.err.println("FOUND: " + tree.getTag() + " " + trim(tree, 64));
found
.
add
(
tree
);
super
.
scan
(
tree
);
}
...
...
@@ -130,7 +131,7 @@ public class JavacTreeScannerTest extends AbstractTreeScannerTest {
return
;
if
(
o
instanceof
JCTree
)
{
JCTree
tree
=
(
JCTree
)
o
;
System
.
err
.
println
(
"EXPECT: "
+
tree
.
getTag
()
+
" "
+
trim
(
tree
,
64
));
//
System.err.println("EXPECT: " + tree.getTag() + " " + trim(tree, 64));
expect
.
add
(
tree
);
for
(
Field
f:
getFields
(
tree
))
{
try
{
...
...
test/tools/javac/tree/SourceTreeScannerTest.java
浏览文件 @
36b0934e
...
...
@@ -91,12 +91,13 @@ public class SourceTreeScannerTest extends AbstractTreeScannerTest {
scan
(
tree
,
null
);
expect
=
new
HashSet
<
Tree
>();
reflectiveScan
(
tree
);
if
(
found
.
equals
(
expect
))
{
System
.
err
.
println
(
found
.
size
()
+
"
trees compared OK"
);
//System.err.println(sourcefile.getName() + ":
trees compared OK");
return
found
.
size
();
}
error
(
"Differences found for "
+
tree
.
sourcefile
.
getName
()
);
error
(
sourcefile
.
getName
()
+
": differences found"
);
if
(
found
.
size
()
!=
expect
.
size
())
error
(
"Size mismatch; found: "
+
found
.
size
()
+
", expected: "
+
expect
.
size
());
...
...
@@ -105,13 +106,13 @@ public class SourceTreeScannerTest extends AbstractTreeScannerTest {
missing
.
addAll
(
expect
);
missing
.
removeAll
(
found
);
for
(
Tree
t:
missing
)
error
(
tree
.
sourcefile
,
t
,
"missing"
);
error
(
sourcefile
,
t
,
"missing"
);
Set
<
Tree
>
excess
=
new
HashSet
<
Tree
>();
excess
.
addAll
(
found
);
excess
.
removeAll
(
expect
);
for
(
Tree
t:
excess
)
error
(
tree
.
sourcefile
,
t
,
"unexpected"
);
error
(
sourcefile
,
t
,
"unexpected"
);
return
0
;
}
...
...
@@ -121,7 +122,7 @@ public class SourceTreeScannerTest extends AbstractTreeScannerTest {
public
Void
scan
(
Tree
tree
,
Void
ignore
)
{
if
(
tree
==
null
)
return
null
;
System
.
err
.
println
(
"FOUND: "
+
tree
.
getKind
()
+
" "
+
trim
(
tree
,
64
));
//
System.err.println("FOUND: " + tree.getKind() + " " + trim(tree, 64));
found
.
add
(
tree
);
return
super
.
scan
(
tree
,
ignore
);
}
...
...
@@ -132,7 +133,7 @@ public class SourceTreeScannerTest extends AbstractTreeScannerTest {
return
;
if
(
o
instanceof
JCTree
)
{
JCTree
tree
=
(
JCTree
)
o
;
System
.
err
.
println
(
"EXPECT: "
+
tree
.
getKind
()
+
" "
+
trim
(
tree
,
64
));
//
System.err.println("EXPECT: " + tree.getKind() + " " + trim(tree, 64));
expect
.
add
(
tree
);
for
(
Field
f:
getFields
(
tree
))
{
if
(
TypeBoundKind
.
class
.
isAssignableFrom
(
f
.
getType
()))
{
...
...
test/tools/javap/T6868539.java
浏览文件 @
36b0934e
...
...
@@ -39,25 +39,25 @@ public class T6868539
}
void
run
()
{
verify
(
"T6868539"
,
"Utf8 +java/lang/String"
);
// 1: Utf8
String
output
=
javap
(
"T6868539"
);
verify
(
output
,
"Utf8 +java/lang/String"
);
// 1: Utf8
// 2: currently unused
verify
(
"T6868539"
,
"Integer +123456"
);
// 3: Integer
verify
(
"T6868539"
,
"Float +123456.0f"
);
// 4: Float
verify
(
"T6868539"
,
"Long +123456l"
);
// 5: Long
verify
(
"T6868539"
,
"Double +123456.0d"
);
// 6: Double
verify
(
"T6868539"
,
"Class +#[0-9]+ +// + T6868539"
);
// 7: Class
verify
(
"T6868539"
,
"String +#[0-9]+ +// + not found"
);
// 8: String
verify
(
"T6868539"
,
"Fieldref +#[0-9]+\\.#[0-9]+ +// +T6868539.errors:I"
);
// 9: Fieldref
verify
(
"T6868539"
,
"Methodref +#[0-9]+\\.#[0-9]+ +// +T6868539.run:\\(\\)V"
);
// 10: Methodref
verify
(
"T6868539"
,
"InterfaceMethodref +#[0-9]+\\.#[0-9]+ +// +java/lang/Runnable\\.run:\\(\\)V"
);
verify
(
output
,
"Integer +123456"
);
// 3: Integer
verify
(
output
,
"Float +123456.0f"
);
// 4: Float
verify
(
output
,
"Long +123456l"
);
// 5: Long
verify
(
output
,
"Double +123456.0d"
);
// 6: Double
verify
(
output
,
"Class +#[0-9]+ +// + T6868539"
);
// 7: Class
verify
(
output
,
"String +#[0-9]+ +// + not found"
);
// 8: String
verify
(
output
,
"Fieldref +#[0-9]+\\.#[0-9]+ +// +T6868539.errors:I"
);
// 9: Fieldref
verify
(
output
,
"Methodref +#[0-9]+\\.#[0-9]+ +// +T6868539.run:\\(\\)V"
);
// 10: Methodref
verify
(
output
,
"InterfaceMethodref +#[0-9]+\\.#[0-9]+ +// +java/lang/Runnable\\.run:\\(\\)V"
);
// 11: InterfaceMethodref
verify
(
"T6868539"
,
"NameAndType +#[0-9]+:#[0-9]+ +// +run:\\(\\)V"
);
// 12: NameAndType
verify
(
output
,
"NameAndType +#[0-9]+:#[0-9]+ +// +run:\\(\\)V"
);
// 12: NameAndType
if
(
errors
>
0
)
throw
new
Error
(
errors
+
" found."
);
}
void
verify
(
String
className
,
String
...
expects
)
{
String
output
=
javap
(
className
);
void
verify
(
String
output
,
String
...
expects
)
{
for
(
String
expect:
expects
)
{
if
(!
output
.
matches
(
"(?s).*"
+
expect
+
".*"
))
error
(
expect
+
" not found"
);
...
...
test/tools/javap/T6980017.java
浏览文件 @
36b0934e
...
...
@@ -39,7 +39,7 @@ public class T6980017 {
String
[]
args
=
{
"-v"
,
"-XDdetails:source"
,
"java.lang.
String
"
"java.lang.
Object
"
};
StringWriter
sw
=
new
StringWriter
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录