Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
d318761e
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看板
提交
d318761e
编写于
2月 15, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6926555: 6921979 breaks TreePosTest
Reviewed-by: darcy
上级
e6ca4d91
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
4 deletion
+14
-4
test/tools/javac/treepostests/TreePosTest.java
test/tools/javac/treepostests/TreePosTest.java
+14
-4
未找到文件。
test/tools/javac/treepostests/TreePosTest.java
浏览文件 @
d318761e
...
...
@@ -98,7 +98,7 @@ import static com.sun.tools.javac.util.Position.NOPOS;
* @test
* @bug 6919889
* @summary assorted position errors in compiler syntax trees
* @run main TreePosTest -q -r -ef ./tools/javac/typeAnnotations -ef ./tools/javap/typeAnnotations .
* @run main TreePosTest -q -r -ef ./tools/javac/typeAnnotations -ef ./tools/javap/typeAnnotations
-et ANNOTATED_TYPE
.
*/
public
class
TreePosTest
{
/**
...
...
@@ -150,6 +150,8 @@ public class TreePosTest {
tags
.
add
(
args
[++
i
]);
else
if
(
arg
.
equals
(
"-ef"
)
&&
i
+
1
<
args
.
length
)
excludeFiles
.
add
(
new
File
(
baseDir
,
args
[++
i
]));
else
if
(
arg
.
equals
(
"-et"
)
&&
i
+
1
<
args
.
length
)
excludeTags
.
add
(
args
[++
i
]);
else
if
(
arg
.
equals
(
"-r"
))
{
if
(
excludeFiles
.
size
()
>
0
)
throw
new
Error
(
"-r must be used before -ef"
);
...
...
@@ -199,6 +201,7 @@ public class TreePosTest {
out
.
println
(
"-t tag Limit checks to tree nodes with this tag"
);
out
.
println
(
" Can be repeated if desired"
);
out
.
println
(
"-ef file Exclude file or directory"
);
out
.
println
(
"-et tag Exclude tree nodes with given tag name"
);
out
.
println
(
""
);
out
.
println
(
"files may be directories or files"
);
out
.
println
(
"directories will be scanned recursively"
);
...
...
@@ -304,6 +307,8 @@ public class TreePosTest {
Set
<
String
>
tags
=
new
HashSet
<
String
>();
/** Set of files and directories to be excluded from analysis. */
Set
<
File
>
excludeFiles
=
new
HashSet
<
File
>();
/** Set of tag names to be excluded from analysis. */
Set
<
String
>
excludeTags
=
new
HashSet
<
String
>();
/** Table of printable names for tree tag values. */
TagNames
tagNames
=
new
TagNames
();
...
...
@@ -324,7 +329,7 @@ public class TreePosTest {
return
;
Info
self
=
new
Info
(
tree
,
endPosTable
);
if
(
check
(
self
))
{
if
(
check
(
encl
,
self
))
{
// Modifiers nodes are present throughout the tree even where
// there is no corresponding source text.
// Redundant semicolons in a class definition can cause empty
...
...
@@ -392,8 +397,13 @@ public class TreePosTest {
super
.
visitVarDef
(
tree
);
}
boolean
check
(
Info
x
)
{
return
tags
.
size
()
==
0
||
tags
.
contains
(
tagNames
.
get
(
x
.
tag
));
boolean
check
(
Info
encl
,
Info
self
)
{
if
(
excludeTags
.
size
()
>
0
)
{
if
(
encl
!=
null
&&
excludeTags
.
contains
(
tagNames
.
get
(
encl
.
tag
))
||
excludeTags
.
contains
(
tagNames
.
get
(
self
.
tag
)))
return
false
;
}
return
tags
.
size
()
==
0
||
tags
.
contains
(
tagNames
.
get
(
self
.
tag
));
}
void
check
(
String
label
,
Info
encl
,
Info
self
,
boolean
ok
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录