src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java

changeset 1443
cfde9737131e
parent 1359
25e14ad23cef
child 1464
f72c9c5aeaef
     1.1 --- a/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java	Mon Dec 10 16:21:26 2012 +0000
     1.2 +++ b/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java	Tue Dec 11 15:05:55 2012 -0800
     1.3 @@ -29,10 +29,12 @@
     1.4  import java.text.CollationKey;
     1.5  
     1.6  import com.sun.javadoc.*;
     1.7 +import com.sun.source.util.TreePath;
     1.8  import com.sun.tools.javac.code.Attribute;
     1.9  import com.sun.tools.javac.code.Symbol;
    1.10  import com.sun.tools.javac.code.Symbol.ClassSymbol;
    1.11  import com.sun.tools.javac.tree.JCTree;
    1.12 +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
    1.13  import com.sun.tools.javac.util.Position;
    1.14  
    1.15  /**
    1.16 @@ -66,16 +68,20 @@
    1.17      // Cache for getModifiers().
    1.18      private int modifiers = -1;
    1.19  
    1.20 -    protected ProgramElementDocImpl(DocEnv env, Symbol sym,
    1.21 -                                    String doc, JCTree tree, Position.LineMap lineMap) {
    1.22 -        super(env, doc);
    1.23 +    protected ProgramElementDocImpl(DocEnv env, Symbol sym, TreePath treePath) {
    1.24 +        super(env, treePath);
    1.25          this.sym = sym;
    1.26 -        this.tree = tree;
    1.27 -        this.lineMap = lineMap;
    1.28 +        if (treePath != null) {
    1.29 +            tree = (JCTree) treePath.getLeaf();
    1.30 +            lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
    1.31 +        }
    1.32      }
    1.33  
    1.34 -    void setTree(JCTree tree) {
    1.35 -        this.tree = tree;
    1.36 +    @Override
    1.37 +    void setTreePath(TreePath treePath) {
    1.38 +        super.setTreePath(treePath);
    1.39 +        this.tree = (JCTree) treePath.getLeaf();
    1.40 +        this.lineMap = ((JCCompilationUnit) treePath.getCompilationUnit()).lineMap;
    1.41      }
    1.42  
    1.43      /**

mercurial