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

new Reporter method to report a diagnostic within a DocTree node

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 18
    • 18
    • tools
    • None

      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.

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

              Created:
              Updated:
              Resolved: