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

NPE in MembersPhase.finishClass

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: tools
    • Subcomponent:
    • Resolved In Build:
      b153
    • Verification:
      Verified

      Description

      The following ill-formed program crashes javac 9-ea+149 with annotation processing enabled:

      === Test.java ===
      @Deprecated enum Test implements Test {}
      ===

      === Processor.java ===
      import java.util.Set;
      import javax.annotation.processing.*;
      import javax.lang.model.element.TypeElement;

      @SupportedAnnotationTypes("*")
      public class Processor extends AbstractProcessor {
        @Override
        public boolean process(Set<? extends TypeElement> set, RoundEnvironment roundEnvironment) {
          return false;
        }
      }
      ===

      $ javac Processor.java
      $ javac Test.java -processor Processor

      java.lang.NullPointerException
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.finishClass(TypeEnter.java:941)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.runPhase(TypeEnter.java:929)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.doCompleteEnvs(TypeEnter.java:270)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$MembersPhase.doCompleteEnvs(TypeEnter.java:864)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:245)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:254)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:254)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter$Phase.completeEnvs(TypeEnter.java:254)
              at jdk.compiler/com.sun.tools.javac.comp.TypeEnter.complete(TypeEnter.java:195)
              at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)
              at jdk.compiler/com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1273)
              at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:569)
              at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:546)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1069)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:940)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:307)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:160)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:55)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:41)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vromero Vicente Arturo Romero Zaldivar
              Reporter:
              cushon Liam Miller-Cushon
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: