FULL PRODUCT VERSION :
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [vers��o 6.3.9600]
Windows 8.1 64bits pt-br
EXTRA RELEVANT SYSTEM CONFIGURATION :
Hardware: Intel Core i5-2410M 2.3 GHz
A DESCRIPTION OF THE PROBLEM :
The following program presents no compilation error when compiling in Oracle JDK but it must not be compilable.
Program
public class A {
public class B extends A {
public class C extends B {}
}
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Save above program into a file called A.java and try to execute javac compiler.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Compilation error: No enclosing instance of type A is available due to some intermediate constructor invocation
ACTUAL -
No compilation errors.
REPRODUCIBILITY :
This bug can be reproduced always.