-
Bug
-
Resolution: Fixed
-
P4
-
8u20, 8u40
-
b42
-
x86_64
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085271 | emb-9 | Vicente Arturo Romero Zaldivar | P4 | Resolved | Fixed | team |
JDK-8067611 | 8u45 | Vicente Arturo Romero Zaldivar | P4 | Resolved | Fixed | b01 |
JDK-8065389 | 8u40 | Vicente Arturo Romero Zaldivar | P4 | Resolved | Fixed | b17 |
JDK-8070292 | emb-8u47 | Vicente Arturo Romero Zaldivar | P4 | Resolved | Fixed | team |
FULL PRODUCT VERSION :
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b20)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b20, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows.
All
A DESCRIPTION OF THE PROBLEM :
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
The compiler compiles the code without any issues.
JLS 15.11.2. Accessing Superclass Members using super
"The form T.super.Identifier refers to the field named Identifier of the lexically enclosing instance corresponding to T, but with that instance viewed as an instance of the superclass of T."
The statement does not mention anything about Interfaces.
In my opinion the compiler should throw for T.super.f.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The compiler should throw for T.super.f.
ACTUAL -
The code compiles fine without any issues.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
---------- END SOURCE ----------
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b20)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b20, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows.
All
A DESCRIPTION OF THE PROBLEM :
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
The compiler compiles the code without any issues.
JLS 15.11.2. Accessing Superclass Members using super
"The form T.super.Identifier refers to the field named Identifier of the lexically enclosing instance corresponding to T, but with that instance viewed as an instance of the superclass of T."
The statement does not mention anything about Interfaces.
In my opinion the compiler should throw for T.super.f.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The compiler should throw for T.super.f.
ACTUAL -
The code compiles fine without any issues.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
interface T2 { int f = 0; }
interface T extends T2 { int f = 0; }
class X implements T {
int i = T.super.f;
}
---------- END SOURCE ----------
- backported by
-
JDK-8065389 Missing compile error in Java 8 mode for Interface.super.field access
-
- Resolved
-
-
JDK-8067611 Missing compile error in Java 8 mode for Interface.super.field access
-
- Resolved
-
-
JDK-8070292 Missing compile error in Java 8 mode for Interface.super.field access
-
- Resolved
-
-
JDK-8085271 Missing compile error in Java 8 mode for Interface.super.field access
-
- Resolved
-
- relates to
-
JDK-7192246 Add type-checking support for default methods
-
- Closed
-