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

new Reporter method to report a diagnostic within a DocTree node

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 18
    • 18
    • tools
    • None

    Description

      Various subtypes of DocTree are wrappers around a somewhat open-ended String. It would help to be able to report diagnostics at positions within that string.

      The following shows candidate subtypes:
      open/src/jdk.compiler/share/classes/com/sun/source/doctree/CommentTree.java: String getBody();
      open/src/jdk.compiler/share/classes/com/sun/source/doctree/DocTypeTree.java: String getText();
      open/src/jdk.compiler/share/classes/com/sun/source/doctree/ReferenceTree.java: String getSignature();
      open/src/jdk.compiler/share/classes/com/sun/source/doctree/TextTree.java: String getBody();

      There is an existing method on Reporter as follows:
          void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message);

      The proposal is to add an overload which takes a DocTreePath instead of a FileObject, in order to identify a DocTree within a doc comment that is the target of the diagnostic.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: