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

Clarify documentation for Taglet.Location.OVERVIEW

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 20
    • tools

      I have recently learned that doc-files/**/*.html files are treated as OVERVIEW files:

      src/java.base/share/classes/java/net/doc-files/net-properties.html:47: warning: Tag @systemProperty cannot be used in overview documentation. It can only be used in the following types of documentation: module, package, class/interface, constructor, field, method.
      <LI><P><B>{@systemProperty java.net.preferIPv4Stack}</B> (default: false)<BR>
      ^

      This is because of this code:

                          @Override
                          public Void visitUnknown(Element e, Void p) {
                              if (utils.isOverviewElement(e) && !taglet.inOverview()) {
                                  printTagMisuseWarn(utils.getCommentHelper(e), taglet, tag, "overview");
                              }
                              return null;
                          }
      ...

          public boolean isOverviewElement(Element e) {
              return e.getKind() == ElementKind.OTHER;
          }

      While it might be impractical to introduce a new location to cover other documentation, such as doc-files/**/*.html, a clarification to the existing Taglet.Location.OVERVIEW might be a better alternative. The suggestion is as follows:

      --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
      +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Taglet.java
      @@ -147,7 +147,7 @@ public interface Taglet {
            * The kind of location in which a tag may be used.
            */
           enum Location {
      - /** In an Overview document. */
      + /** In an Overview and other documentation. */
               OVERVIEW,


      ---
      Please keep in mind that this bug might not be easily reproducible after JDK-8288524.

            prappo Pavel Rappo
            prappo Pavel Rappo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: