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

javac crashes (NPE) on invalid module declaration

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9-repo-jigsaw
    • Fix Version/s: 9-repo-jigsaw
    • Component/s: tools
    • Labels:

      Description

      javac crashes (and does not reject) a module declaration with a package statement

      $ cat play/src/x/module-info.java
      package p;

      module x { }
      jjg@jjg-Precision-T7600:/w/jjg/work/jigsaw/jake$ ./build/linux-x86_64-normal-server-release/jdk/bin/javac play/src/x/module-info.java
      An exception has occurred in the compiler (9-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 and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException
      at com.sun.tools.javac.comp.TypeEnter$ImportsPhase.checkClassPackageClash(jdk.compiler/TypeEnter.java:377)
      at com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(jdk.compiler/TypeEnter.java:348)
      at com.sun.tools.javac.comp.TypeEnter$ImportsPhase.access$1700(jdk.compiler/TypeEnter.java:290)
      at com.sun.tools.javac.comp.TypeEnter.lambda$ensureImportsChecked$0(jdk.compiler/TypeEnter.java:167)
      at com.sun.tools.javac.comp.TypeEnter.finishImports(jdk.compiler/TypeEnter.java:218)
      at com.sun.tools.javac.comp.TypeEnter.ensureImportsChecked(jdk.compiler/TypeEnter.java:167)
      at com.sun.tools.javac.comp.Enter.complete(jdk.compiler/Enter.java:557)
      at com.sun.tools.javac.comp.Enter.main(jdk.compiler/Enter.java:528)
      at com.sun.tools.javac.main.JavaCompiler.enterTrees(jdk.compiler/JavaCompiler.java:1038)
      at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler/JavaCompiler.java:904)
      at com.sun.tools.javac.main.Main.compile(jdk.compiler/Main.java:281)
      at com.sun.tools.javac.main.Main.compile(jdk.compiler/Main.java:144)
      at com.sun.tools.javac.Main.compile(jdk.compiler/Main.java:55)
      at com.sun.tools.javac.Main.main(jdk.compiler/Main.java:41)

        Attachments

          Activity

            People

            Assignee:
            jlahoda Jan Lahoda
            Reporter:
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: