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

Update Elements for '///' documentation comments

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 23
    • core-libs
    • None
    • behavioral
    • low
    • The behavior of the existing getDocComment method is enhanced to recognize the new kind of comment, and a new method is added to inspect the kind of documentation comment that may be present.
    • Java API
    • SE

      Summary

      Support the new "end-of-line"-style documentation comments introduced by JEP 467.

      Problem

      JEP 467 introduces a new "kind" of documentation comment, based on the use of end-of-line comments. While this is primarily a JDK feature for use by the javadoc tool, the Java SE class javax.lang.model.util.Elements exposes the ability to access the documentation comment for an Element.

      At a minimum, the specification of the existing getDocComment method needs to be updated to accommodate the new kind of comment. Given that it may be reasonable to assign different semantics to the different "kinds" of comment (traditional and end-of-line), it is desirable to expose that difference as well to anyone wanting to access the documentation comment for an element.

      Solution

      • Update the specification for Elements.getDocComment
      • Introduce enum DocCommentKind to represent the different kinds of documentation comment, and add a new method in Elements to access the kind of comment for an element.

      Specification

      The API differences are attached, in both specdiff and apidiff format. The latest version is .04. The differences can also be viewed here: https://cr.openjdk.org/~jjg/8329296/

        1. apidiff.00.zip
          76 kB
        2. apidiff.01.zip
          76 kB
        3. apidiff.02.zip
          76 kB
        4. apidiff.03.zip
          76 kB
        5. apidiff.04.zip
          76 kB
        6. specdiff.00.zip
          835 kB
        7. specdiff.01.zip
          835 kB
        8. specdiff.02.zip
          835 kB
        9. specdiff.03.zip
          844 kB
        10. specdiff.04.zip
          845 kB

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Pavel Rappo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: