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

Review Checker.java visitReturn and visitSummary

XMLWordPrintable

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

      Re: discussion in https://github.com/openjdk/jdk/pull/12372#discussion_r1099142881

      In doc comments, `{@return...}` and `{@summary...}` should each appear at the beginning of a doc comment.
      In `Checker.java`, `visitReturn` and `visitSummary` use different methodology for checking the position.

      * `visitReturn` simply checks that the node is the first child of the first sentence of the enclosing `DocCommentTree`
      * `visitSummary` tries to be more lenient and allows the node to appear after whitespace text, but in so doing allows through some edge cases (entity or escape immediately before the summary node.)

      The reported errors are different as well: `dc.return.not.first`, `dc.invalid.summary`.

      It would be good to align the handling for these two kinds of tree nodes.

            Unassigned Unassigned
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: