Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
c9a2db6f
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看板
提交
c9a2db6f
编写于
12月 04, 2013
作者:
M
mchung
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8029216: (jdeps) Provide a specific option to report JDK internal APIs
Reviewed-by: alanb
上级
8e4e8963
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
59 addition
and
6 deletion
+59
-6
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
+35
-4
src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
...re/classes/com/sun/tools/jdeps/resources/jdeps.properties
+9
-0
test/tools/jdeps/APIDeps.java
test/tools/jdeps/APIDeps.java
+15
-2
未找到文件。
src/share/classes/com/sun/tools/jdeps/JdepsTask.java
浏览文件 @
c9a2db6f
...
...
@@ -180,6 +180,15 @@ class JdepsTask {
task
.
options
.
depth
=
0
;
}
},
new
Option
(
false
,
"-jdkinternals"
)
{
void
process
(
JdepsTask
task
,
String
opt
,
String
arg
)
{
task
.
options
.
findJDKInternals
=
true
;
task
.
options
.
verbose
=
Analyzer
.
Type
.
CLASS
;
if
(
task
.
options
.
includePattern
==
null
)
{
task
.
options
.
includePattern
=
Pattern
.
compile
(
".*"
);
}
}
},
new
Option
(
false
,
"-version"
)
{
void
process
(
JdepsTask
task
,
String
opt
,
String
arg
)
{
task
.
options
.
version
=
true
;
...
...
@@ -248,6 +257,11 @@ class JdepsTask {
showHelp
();
return
EXIT_CMDERR
;
}
if
(
options
.
findJDKInternals
&&
(
options
.
regex
!=
null
||
options
.
packageNames
.
size
()
>
0
||
options
.
showSummary
))
{
showHelp
();
return
EXIT_CMDERR
;
}
if
(
options
.
showSummary
&&
options
.
verbose
!=
Analyzer
.
Type
.
SUMMARY
)
{
showHelp
();
return
EXIT_CMDERR
;
...
...
@@ -571,6 +585,7 @@ class JdepsTask {
boolean
wildcard
;
boolean
apiOnly
;
boolean
showLabel
;
boolean
findJDKInternals
;
String
dotOutputDir
;
String
classpath
=
""
;
int
depth
=
1
;
...
...
@@ -681,11 +696,22 @@ class JdepsTask {
@Override
public
void
visitDependence
(
String
origin
,
Archive
source
,
String
target
,
Archive
archive
,
Profile
profile
)
{
if
(!
origin
.
equals
(
pkg
))
{
pkg
=
origin
;
writer
.
format
(
" %s (%s)%n"
,
origin
,
source
.
getFileName
());
if
(
options
.
findJDKInternals
&&
!(
archive
instanceof
JDKArchive
&&
profile
==
null
))
{
// filter dependences other than JDK internal APIs
return
;
}
if
(
options
.
verbose
==
Analyzer
.
Type
.
VERBOSE
)
{
writer
.
format
(
" %-50s -> %-50s %s%n"
,
origin
,
target
,
getProfileArchiveInfo
(
archive
,
profile
));
}
else
{
if
(!
origin
.
equals
(
pkg
))
{
pkg
=
origin
;
writer
.
format
(
" %s (%s)%n"
,
origin
,
source
.
getFileName
());
}
writer
.
format
(
" -> %-50s %s%n"
,
target
,
getProfileArchiveInfo
(
archive
,
profile
));
}
writer
.
format
(
" -> %-50s %s%n"
,
target
,
getProfileArchiveInfo
(
archive
,
profile
));
}
@Override
...
...
@@ -717,6 +743,11 @@ class JdepsTask {
@Override
public
void
visitDependence
(
String
origin
,
Archive
source
,
String
target
,
Archive
archive
,
Profile
profile
)
{
if
(
options
.
findJDKInternals
&&
!(
archive
instanceof
JDKArchive
&&
profile
==
null
))
{
// filter dependences other than JDK internal APIs
return
;
}
// if -P option is specified, package name -> profile will
// be shown and filter out multiple same edges.
String
name
=
getProfileArchiveInfo
(
archive
,
profile
);
...
...
src/share/classes/com/sun/tools/jdeps/resources/jdeps.properties
浏览文件 @
c9a2db6f
...
...
@@ -59,10 +59,19 @@ main.opt.apionly=\
main.opt.dotoutput
=
\
\
-dotoutput <dir> Destination directory for DOT file output
main.opt.jdkinternals
=
\
\
-jdkinternals Finds class-level dependences on JDK internal APIs.
\n\
\
By default, it analyzes all classes on -classpath
\n\
\
and input files unless -include option is specified.
\n\
\
This option cannot be used with -p, -e and -s options.
\n\
\
WARNING: JDK internal APIs may not be accessible in
\n\
\
the next release.
main.opt.depth
=
\
\
-depth=<depth> Specify the depth of the transitive
\n\
\
dependency analysis
err.unknown.option
=
unknown option: {0}
err.missing.arg
=
no value given for {0}
err.internal.error
=
internal error: {0} {1} {2}
...
...
test/tools/jdeps/APIDeps.java
浏览文件 @
c9a2db6f
...
...
@@ -23,8 +23,8 @@
/*
* @test
* @bug 8015912
* @summary
find API dependencie
s
* @bug 8015912
8029216
* @summary
Test -apionly and -jdkinternals option
s
* @build m.Bar m.Foo m.Gee b.B c.C c.I d.D e.E f.F g.G
* @run main APIDeps
*/
...
...
@@ -88,6 +88,19 @@ public class APIDeps {
new
String
[]
{
"g.G"
,
"sun.misc.Lock"
},
new
String
[]
{
testDirBasename
,
"JDK internal API"
},
new
String
[]
{
"-classpath"
,
testDir
.
getPath
(),
"-verbose"
});
// -jdkinternals
test
(
new
File
(
mDir
,
"Gee.class"
),
new
String
[]
{
"sun.misc.Lock"
},
new
String
[]
{
"JDK internal API"
},
new
String
[]
{
"-jdkinternals"
});
// -jdkinternals parses all classes on -classpath and the input arguments
test
(
new
File
(
mDir
,
"Gee.class"
),
new
String
[]
{
"sun.misc.Lock"
,
"sun.misc.Unsafe"
},
new
String
[]
{
"JDK internal API"
},
new
String
[]
{
"-classpath"
,
testDir
.
getPath
(),
"-jdkinternals"
});
// parse only APIs
// parse only APIs
test
(
mDir
,
new
String
[]
{
"java.lang.Object"
,
"java.lang.String"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录