Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
24b28329
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看板
提交
24b28329
编写于
11月 24, 2014
作者:
V
vromero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8059921: Missing compile error in Java 8 mode for Interface.super.field access
Reviewed-by: mcimadamore, jlahoda
上级
14ad5d78
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
0 deletion
+38
-0
src/share/classes/com/sun/tools/javac/comp/Attr.java
src/share/classes/com/sun/tools/javac/comp/Attr.java
+4
-0
test/tools/javac/T8059921/ForbidAccessToFieldUsingSuperTest.java
...ols/javac/T8059921/ForbidAccessToFieldUsingSuperTest.java
+31
-0
test/tools/javac/T8059921/ForbidAccessToFieldUsingSuperTest.out
...ools/javac/T8059921/ForbidAccessToFieldUsingSuperTest.out
+3
-0
未找到文件。
src/share/classes/com/sun/tools/javac/comp/Attr.java
浏览文件 @
24b28329
...
...
@@ -3243,6 +3243,10 @@ public class Attr extends JCTree.Visitor {
// Determine the symbol represented by the selection.
env
.
info
.
pendingResolutionPhase
=
null
;
Symbol
sym
=
selectSym
(
tree
,
sitesym
,
site
,
env
,
resultInfo
);
if
(
sym
.
kind
==
VAR
&&
sym
.
name
!=
names
.
_super
&&
env
.
info
.
defaultSuperCallSite
!=
null
)
{
log
.
error
(
tree
.
selected
.
pos
(),
"not.encl.class"
,
site
.
tsym
);
sym
=
syms
.
errSymbol
;
}
if
(
sym
.
exists
()
&&
!
isType
(
sym
)
&&
(
pkind
()
&
(
PCK
|
TYP
))
!=
0
)
{
site
=
capture
(
site
);
sym
=
selectSym
(
tree
,
sitesym
,
site
,
env
,
resultInfo
);
...
...
test/tools/javac/T8059921/ForbidAccessToFieldUsingSuperTest.java
0 → 100644
浏览文件 @
24b28329
/*
* @test /nodynamiccopyright/
* @bug 8059921
* @summary Missing compile error in Java 8 mode for Interface.super.field access
* @compile/fail/ref=ForbidAccessToFieldUsingSuperTest.out -XDrawDiagnostics ForbidAccessToFieldUsingSuperTest.java
*/
public
class
ForbidAccessToFieldUsingSuperTest
{
class
C
{
int
m
()
{
return
0
;
}
}
interface
T
{
int
f
=
0
;
C
c
=
null
;
default
int
mm
()
{
return
0
;
}
}
interface
T1
extends
T
{}
class
X
implements
T1
{
int
i
=
T1
.
super
.
f
;
//fail
int
j
=
T1
.
super
.
c
.
m
();
//fail
void
foo
(
Runnable
r
)
{
foo
(
T1
.
super
::
mm
);
//should'n fail
}
}
}
test/tools/javac/T8059921/ForbidAccessToFieldUsingSuperTest.out
0 → 100644
浏览文件 @
24b28329
ForbidAccessToFieldUsingSuperTest.java:24:19: compiler.err.not.encl.class: ForbidAccessToFieldUsingSuperTest.T1
ForbidAccessToFieldUsingSuperTest.java:25:19: compiler.err.not.encl.class: ForbidAccessToFieldUsingSuperTest.T1
2 errors
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录