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

javadoc NPE with "import module" statement

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 26
    • tools
    • None

      A currently open PR exposed the NPE stack dump below. It can be reproduced by adding the following statement

      import module jdk.httpserver
      in src/jdk.httpserver/share/classes/module-info.java

      Whether that is a valid statement is one question, but it shouldn't cause a javadoc NPE in this way
      ```
      $ make docs
      Building target 'docs' in configuration 'macosx-aarch64'
      Compiling up to 58 files for jdk.httpserver
      Creating ct.sym classes
      Generating JDK_API javadoc for 57 modules
      error: fatal error encountered: java.lang.NullPointerException: Cannot invoke "java.util.Set.contains(Object)" because "this.env.toplevel.modle.readModules" is null
      error: Please file a bug against the javadoc tool via the Java bug reporting page
        (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com)
        for duplicates. Include error messages and the following diagnostic in your report. Thank you.
      java.lang.NullPointerException: Cannot invoke "java.util.Set.contains(Object)" because "this.env.toplevel.modle.readModules" is null
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.doModuleImport(TypeEnter.java:452)
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.handleImports(TypeEnter.java:385)
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter$ImportsPhase.resolveImports(TypeEnter.java:367)
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter.lambda$ensureImportsChecked$0(TypeEnter.java:160)
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter.finishImports(TypeEnter.java:212)
      at jdk.compiler.interim/com.sun.tools.javac.comp.TypeEnter.ensureImportsChecked(TypeEnter.java:160)
      at jdk.compiler.interim/com.sun.tools.javac.comp.Enter.complete(Enter.java:649)
      at jdk.compiler.interim/com.sun.tools.javac.comp.Enter.main(Enter.java:601)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.JavadocEnter.main(JavadocEnter.java:72)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.JavadocTool.getEnvironment(JavadocTool.java:206)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.Start.parseAndExecute(Start.java:581)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.Start.begin(Start.java:399)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.Start.begin(Start.java:348)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.Main.execute(Main.java:57)
      at jdk.javadoc.interim/jdk.javadoc.internal.tool.Main.main(Main.java:46)
      2 errors
      Docs.gmk:490: recipe for target '/Users/mimcmah/git/jdk/build/macosx-aarch64/support/docs/_javadoc_JDK_API_exec.marker' failed
      make[3]: *** [/Users/mimcmah/git/jdk/build/macosx-aarch64/support/docs/_javadoc_JDK_API_exec.marker] Error 4
      make/Main.gmk:529: recipe for target 'docs-jdk-api-javadoc' failed
      make[2]: *** [docs-jdk-api-javadoc] Error 2
      make[2]: *** Waiting for unfinished jobs....
      ```
      This is with fully synced (as of today) jdk open and closed.

            jlahoda Jan Lahoda
            michaelm Michael McMahon
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: