Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
90149e48
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看板
提交
90149e48
编写于
2月 26, 2010
作者:
J
jjg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6930032: fix findbugs errors in com.sun.tools.javac.comp
Reviewed-by: darcy
上级
4bd5c83b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
13 deletion
+17
-13
src/share/classes/com/sun/tools/javac/comp/Enter.java
src/share/classes/com/sun/tools/javac/comp/Enter.java
+11
-9
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
+6
-4
未找到文件。
src/share/classes/com/sun/tools/javac/comp/Enter.java
浏览文件 @
90149e48
...
...
@@ -270,6 +270,7 @@ public class Enter extends JCTree.Visitor {
return
ts
.
toList
();
}
@Override
public
void
visitTopLevel
(
JCCompilationUnit
tree
)
{
JavaFileObject
prev
=
log
.
useSource
(
tree
.
sourcefile
);
boolean
addEnv
=
false
;
...
...
@@ -289,13 +290,13 @@ public class Enter extends JCTree.Visitor {
tree
.
packge
=
syms
.
unnamedPackage
;
}
tree
.
packge
.
complete
();
// Find all classes in package.
Env
<
AttrContext
>
e
nv
=
topLevelEnv
(
tree
);
Env
<
AttrContext
>
topE
nv
=
topLevelEnv
(
tree
);
// Save environment of package-info.java file.
if
(
isPkgInfo
)
{
Env
<
AttrContext
>
env0
=
typeEnvs
.
get
(
tree
.
packge
);
if
(
env0
==
null
)
{
typeEnvs
.
put
(
tree
.
packge
,
e
nv
);
typeEnvs
.
put
(
tree
.
packge
,
topE
nv
);
}
else
{
JCCompilationUnit
tree0
=
env0
.
toplevel
;
if
(!
fileManager
.
isSameFile
(
tree
.
sourcefile
,
tree0
.
sourcefile
))
{
...
...
@@ -306,7 +307,7 @@ public class Enter extends JCTree.Visitor {
if
(
addEnv
||
(
tree0
.
packageAnnotations
.
isEmpty
()
&&
tree
.
docComments
!=
null
&&
tree
.
docComments
.
get
(
tree
)
!=
null
))
{
typeEnvs
.
put
(
tree
.
packge
,
e
nv
);
typeEnvs
.
put
(
tree
.
packge
,
topE
nv
);
}
}
}
...
...
@@ -322,14 +323,15 @@ public class Enter extends JCTree.Visitor {
c
.
members_field
=
new
Scope
(
c
);
tree
.
packge
.
package_info
=
c
;
}
classEnter
(
tree
.
defs
,
e
nv
);
classEnter
(
tree
.
defs
,
topE
nv
);
if
(
addEnv
)
{
todo
.
append
(
e
nv
);
todo
.
append
(
topE
nv
);
}
log
.
useSource
(
prev
);
result
=
null
;
}
@Override
public
void
visitClassDef
(
JCClassDecl
tree
)
{
Symbol
owner
=
env
.
info
.
scope
.
owner
;
Scope
enclScope
=
enterScope
(
env
);
...
...
@@ -435,6 +437,7 @@ public class Enter extends JCTree.Visitor {
* Enter a symbol for type parameter in local scope, after checking that it
* is unique.
*/
@Override
public
void
visitTypeParameter
(
JCTypeParameter
tree
)
{
TypeVar
a
=
(
tree
.
type
!=
null
)
?
(
TypeVar
)
tree
.
type
...
...
@@ -448,6 +451,7 @@ public class Enter extends JCTree.Visitor {
/** Default class enter visitor method: do nothing.
*/
@Override
public
void
visitTree
(
JCTree
tree
)
{
result
=
null
;
}
...
...
@@ -489,10 +493,8 @@ public class Enter extends JCTree.Visitor {
for
(
JCCompilationUnit
tree
:
trees
)
{
if
(
tree
.
starImportScope
.
elems
==
null
)
{
JavaFileObject
prev
=
log
.
useSource
(
tree
.
sourcefile
);
Env
<
AttrContext
>
env
=
typeEnvs
.
get
(
tree
);
if
(
env
==
null
)
env
=
topLevelEnv
(
tree
);
memberEnter
.
memberEnter
(
tree
,
env
);
Env
<
AttrContext
>
topEnv
=
topLevelEnv
(
tree
);
memberEnter
.
memberEnter
(
tree
,
topEnv
);
log
.
useSource
(
prev
);
}
}
...
...
src/share/classes/com/sun/tools/javac/comp/TransTypes.java
浏览文件 @
90149e48
...
...
@@ -607,10 +607,12 @@ public class TransTypes extends TreeTranslator {
public
void
visitNewArray
(
JCNewArray
tree
)
{
tree
.
elemtype
=
translate
(
tree
.
elemtype
,
null
);
translate
(
tree
.
dims
,
syms
.
intType
);
tree
.
elems
=
translate
(
tree
.
elems
,
(
tree
.
type
==
null
)
?
null
:
erasure
(
types
.
elemtype
(
tree
.
type
)));
tree
.
type
=
erasure
(
tree
.
type
);
if
(
tree
.
type
!=
null
)
{
tree
.
elems
=
translate
(
tree
.
elems
,
erasure
(
types
.
elemtype
(
tree
.
type
)));
tree
.
type
=
erasure
(
tree
.
type
);
}
else
{
tree
.
elems
=
translate
(
tree
.
elems
,
null
);
}
result
=
tree
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录