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

fix comment in DCReference

    XMLWordPrintable

Details

    • b128
    • Not verified

    Description

      Couple of issues:
      1. The following comment is incorrect in DCTree.java
         public static class DCReference extends DCEndPosTree<DCReference> implements ReferenceTree {
              public final String signature;

              // The following are not directly exposed through ReferenceTree
              // use DocTrees.getElement(TreePath,ReferenceTree)
              public final JCTree qualifierExpression;

       DocTrees.getElement(TreePath,ReferenceTree) does not exist.

      DocTrees.getElement(TreePath) exists albeit it returns the wrong element ie. the holder or owner
      of the DocTree.

      The following are the steps to extract the TypeElement, of a ThrowsTree's thrown TypeElement
      such as java.io.IOException
          ReferenceTree exceptionName = ((ThrowsTree) dtree).getExceptionName();
          DocTreePath path = DocTreePath.getPath(path, docCommentTree, exceptionName);
          System.out.println((TypeElement) instance.getElement(path));

      Attachments

        Activity

          People

            jjg Jonathan Gibbons
            ksrini Kumar Srinivasan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: