FULL PRODUCT VERSION :
javac 1.8.0_141
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 10.0.10586]
A DESCRIPTION OF THE PROBLEM :
The attached program can't find E, which is a class in an interface which extends another interface in the outer class' superclass. JDK 9 and Eclipse compiles this fine.
This seems similar to JDK-7177814, but that relates more to import statements.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached files.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The compilation succeeds.
ACTUAL -
Compilation fails.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
javac -sourcepath src/main/java/ -d bin src/main/java/c/C.java
src\main\java\c\C.java:12: error: cannot find symbol
public interface D extends B {
^
symbol: class B
location: class C
1 error
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
==== a/A.java ====
package a;
import java.util.EventListener;
public abstract class A {
public interface B extends EventListener {
public void changedEvent(A a);
}
}
==== c/C.java ====
package c;
import c.C.D.E;
import a.A;
public abstract class C extends A {
public void f() {
new E();
}
public interface D extends B {
public static class E {
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Change "new E()" to "new D.E", and remove "import c.C.D.E".