title: Java 8 upgrade causes compiler error with inherited static enum
body: <p>We're upgrading a Java 6 project to Java 8. Recompiling with Java 8 gives errors in a java.awt.Frame subclass, I've simplified to the following:</p>
  
  <p>org/example/Foo.java</p>
  
  <pre><code>package org.example;
  
  import org.example.Type;
  import java.awt.Frame;
  
  public class Foo extends Frame {
      public Foo() {
          System.out.println(Type.BAZ);  // &lt;=== error here, BAZ cannot be resolved
      }
  }
  </code></pre>
  
  <p>org/example/Type.java</p>
  
  <pre><code>package org.example;
  
  public class Type {
      public static final int BAZ = 1;
  }
  </code></pre>
  
  <p>What appears to be happening is a static enum <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/Window.Type.html" rel="nofollow noreferrer">java.awt.Window.Type</a> introduced in Java 7 is taking precedence even though there is an import for org.example.Type. Is this correct?</p>
  
  <p>Does this mean we'll have to fully qualify all references to our Type with org.example.Type?</p>