Compilation (still) depends on order of imports

Liam Miller-Cushon cushon at
Sun Mar 15 22:00:51 UTC 2015

I think I found a bug related to JEP 216. With javac9-dev @ r2850, the
following program fails to compile unless the order of imports is reversed.

It looks like the current implementation isn't lazy enough to handle the
dependency between the two on-demand imports if 'I' is inherited into 'C'.
If 'I' is declared directly in 'C' then it works.

package P;

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

public class Outer {
  public static class Nested implements I {

package P.Q;

public class C extends D {

package P.Q;

public class D {
  public interface I {

$ javac P/ P/Q/ P/Q/
P/ error: cannot find symbol
  public static class Nested implements I {
  symbol:   class I
  location: class Outer
1 error
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list