Name: ssT124754 Date: 01/31/2001
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
According to JLS 15.11, the only legal uses of super to access fields are:
super.fieldname
classname.super.fieldname
However, Javac 1.3 also compiles this without error:
class Super {
interface I {
int i = 1;
}
}
class Sub extends Super {
Sub() {
System.out.println(super.I.i);
}
}
The construct super.Classname.fieldname (or interfacename, in this case) needs
to be rejected as invalid, or added to the JLS.
(Review ID: 115916)
======================================================================
- duplicates
-
JDK-4488863 javac allows selecting inner class name from expression
-
- Closed
-