Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8284283

javac crashes when several transitive supertypes are missing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • tools
    • None
    • b23

      Consider this case:
      ---Lib.java
      package lib;
      public class Lib implements A, B {}
      interface A {}
      interface B {}
      ---Test.java
      public class Test<E> extends lib.Lib {}
      ---

      $ javac -d out Lib.java
      $ rm out/lib/A.class out/lib/B.class
      $ javac -classpath out -XDdev Test.java
      Test.java:1: error: cannot access A
      public class Test<E> extends lib.Lib {}
             ^
        class file for lib.A not found
      1 error
      An exception has occurred in the compiler (17-internal). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
      java.lang.NullPointerException: Cannot invoke "com.sun.tools.javac.code.Type.hasTag(com.sun.tools.javac.code.TypeTag)" because the return value of "com.sun.tools.javac.code.Type$TypeVar.getUpperBound()" is null
              at jdk.compiler/com.sun.tools.javac.code.Types.getBounds(Types.java:2732)
              at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclic1(Check.java:2392)
              at jdk.compiler/com.sun.tools.javac.comp.Check.checkNonCyclic(Check.java:2378)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.runPhase(TypeEnter.java:1015)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:288)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$AbstractMembersPhase.doCompleteEnvs(TypeEnter.java:928)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:257)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:272)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:272)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:272)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:272)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:272)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:204)
              at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:682)
              at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1410)
              at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:610)
              at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:587)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1042)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:917)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:317)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:176)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:50)
      printing javac parameters to: .../javac.20220404_112804.args

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: