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

Allow javadoc to process unnamed classes

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P3
    • 21, 22
    • tools
    • None

    Description

      Summary

      javadoc is unable to process files containing unnamed classes.

      Problem

      javadoc is unable to process files containing unnamed classes because they are marked synthetic.

      Solution

      Specifically allow classes that are synthetic and are unnamed to generate javadoc.

      Specification

      Remove the statement "The javadoc tool will fail when asked to generate API documentation for a Java file with an unnamed class, as unnamed classes do not define any API accessible from other classes. This behavior may change in a future release." from https://bugs.openjdk.org/browse/JDK-8302326 JEP 445: Unnamed Classes and Instance Main Methods (Preview).

      Change the first paragraph of the Description section of the javadoc tool man page to include unnamed classes.

      diff --git a/closed/src/jdk.javadoc/share/man/javadoc.md b/closed/src/jdk.javadoc/share/man/javadoc.md
      index 14b90e1c16..105db4c245 100644
      --- a/closed/src/jdk.javadoc/share/man/javadoc.md
      +++ b/closed/src/jdk.javadoc/share/man/javadoc.md
      @@ -46,10 +46,10 @@ javadoc - generate HTML pages of API documentation from Java source files
      
       The `javadoc` tool parses the declarations and documentation comments in a set
       of Java source files and produces corresponding HTML pages that describe (by
      -default) the public and protected classes, nested classes (but not anonymous
      -inner classes), interfaces, constructors, methods, and fields. You can use the
      -`javadoc` tool to generate the API documentation or the implementation
      -documentation for a set of source files.
      +default) the public and protected classes, nested and unnamed classes (but not
      +anonymous inner classes), interfaces, constructors, methods, and fields.
      +You can use the`javadoc` tool to generate the API documentation or the
      +implementation documentation for a set of source files.
      
       You can run the `javadoc` tool on entire packages, individual source files, or
       both. When documenting entire packages, you can use the `-subpackages` option

      Attachments

        Issue Links

          Activity

            People

              jlaskey Jim Laskey (Inactive)
              jlaskey Jim Laskey (Inactive)
              Jonathan Gibbons, Pavel Rappo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: