Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
b39b6f8a
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b39b6f8a
编写于
9月 30, 2013
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8023492: jfr.jar gets loaded even though it's not used
Reviewed-by: erikj, mgronlun
上级
e122507b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
55 addition
and
31 deletion
+55
-31
make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
.../tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
+55
-31
未找到文件。
make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
浏览文件 @
b39b6f8a
...
...
@@ -173,6 +173,44 @@ class JarMetaIndex {
*/
private
HashMap
<
String
,
HashSet
<
String
>>
knownPrefixMap
=
new
HashMap
<>();
/*
* A class for mapping package prefixes to the number of
* levels of package elements to include.
*/
static
class
ExtraLevel
{
public
ExtraLevel
(
String
prefix
,
int
levels
)
{
this
.
prefix
=
prefix
;
this
.
levels
=
levels
;
}
String
prefix
;
int
levels
;
}
/*
* A list of the special-cased package names.
*/
private
static
ArrayList
<
ExtraLevel
>
extraLevels
=
new
ArrayList
<>();
static
{
// The order of these statements is significant,
// since we stop looking after the first match.
// Need more precise information to disambiguate
// (illegal) references from applications to
// obsolete backported collections classes in
// com/sun/java/util
extraLevels
.
add
(
new
ExtraLevel
(
"com/sun/java/util/"
,
Integer
.
MAX_VALUE
));
extraLevels
.
add
(
new
ExtraLevel
(
"com/sun/java/"
,
4
));
// Need more information than just first two package
// name elements to determine that classes in
// deploy.jar are not in rt.jar
extraLevels
.
add
(
new
ExtraLevel
(
"com/sun/"
,
3
));
// Need to make sure things in jfr.jar aren't
// confused with other com/oracle/** packages
extraLevels
.
add
(
new
ExtraLevel
(
"com/oracle/jrockit"
,
3
));
}
/*
* We add maximum 5 second level entries to "sun", "java" and
* "javax" entries. Tune this parameter to get a balance on the
...
...
@@ -237,39 +275,25 @@ class JarMetaIndex {
String
[]
pkgElements
=
name
.
split
(
"/"
);
// Last one is the class name; definitely ignoring that
if
(
pkgElements
.
length
>
2
)
{
String
meta
=
null
;
// Need more information than just first two package
// name elements to determine that classes in
// deploy.jar are not in rt.jar
if
(
pkgElements
.
length
>
3
&&
pkgElements
[
0
].
equals
(
"com"
)
&&
pkgElements
[
1
].
equals
(
"sun"
))
{
// Need more precise information to disambiguate
// (illegal) references from applications to
// obsolete backported collections classes in
// com/sun/java/util
if
(
pkgElements
.
length
>
4
&&
pkgElements
[
2
].
equals
(
"java"
))
{
int
bound
=
0
;
if
(
pkgElements
[
3
].
equals
(
"util"
))
{
// Take all of the packages
bound
=
pkgElements
.
length
-
1
;
}
else
{
// Trim it somewhat more
bound
=
4
;
}
meta
=
""
;
for
(
int
j
=
0
;
j
<
bound
;
j
++)
{
meta
+=
pkgElements
[
j
]
+
"/"
;
}
}
else
{
meta
=
pkgElements
[
0
]
+
"/"
+
pkgElements
[
1
]
+
"/"
+
pkgElements
[
2
]
+
"/"
;
String
meta
=
""
;
// Default is 2 levels of package elements
int
levels
=
2
;
// But for some packages we add more elements
for
(
ExtraLevel
el
:
extraLevels
)
{
if
(
name
.
startsWith
(
el
.
prefix
))
{
levels
=
el
.
levels
;
break
;
}
}
else
{
meta
=
pkgElements
[
0
]
+
"/"
+
pkgElements
[
1
]
+
"/"
;
}
indexSet
.
add
(
meta
);
for
(
int
i
=
0
;
i
<
levels
&&
i
<
pkgElements
.
length
-
1
;
i
++)
{
meta
+=
pkgElements
[
i
]
+
"/"
;
}
if
(!
meta
.
equals
(
""
))
{
indexSet
.
add
(
meta
);
}
}
}
// end of "while" loop;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录