JDK-8075274 : Compilation still depends on the order of imports
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2015-03-16
  • Updated: 2016-02-22
  • Resolved: 2015-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b85Fixed
Related Reports
Relates :  
Description
Consider these files:
=== ./P/Outer.java ===
package P;

import static P.Outer.Nested.*;
import static P.Q.C.*;

public class Outer {
  public static class Nested implements I {
  }
}
=== ./P/Q/C.java ===
package P.Q;

public class C extends D {
}
=== ./P/Q/D.java ===
package P.Q;

public class D {
  public interface I {
  }
}
=================

Compiling these files like this:
$ javac P/Outer.java P/Q/C.java P/Q/D.java

fails with:
P/Outer.java:7: error: cannot find symbol
  public static class Nested implements I {
                                        ^
  symbol:   class I
  location: class Outer
1 error

The compilation passes when the compilation runs like:
$ javac P/Q/C.java P/Q/D.java P/Outer.java

This is on:
$ javac -fullversion
javac full version "1.9.0-ea-b54"

Reported here:
http://mail.openjdk.java.net/pipermail/compiler-dev/2015-March/009367.html