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

changeset 1490
fc4cb1577ad6
parent 1443
cfde9737131e
child 1984
189942cdf585
equal deleted inserted replaced
1486:7d2f628f04f1 1490:fc4cb1577ad6
1 /* 1 /*
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
70 @Override 70 @Override
71 public void visitMethodDef(JCMethodDecl tree) { 71 public void visitMethodDef(JCMethodDecl tree) {
72 super.visitMethodDef(tree); 72 super.visitMethodDef(tree);
73 MethodSymbol meth = tree.sym; 73 MethodSymbol meth = tree.sym;
74 if (meth == null || meth.kind != Kinds.MTH) return; 74 if (meth == null || meth.kind != Kinds.MTH) return;
75 TreePath treePath = docenv.getTreePath(env.toplevel, tree); 75 TreePath treePath = docenv.getTreePath(env.toplevel, env.enclClass, tree);
76 if (meth.isConstructor()) 76 if (meth.isConstructor())
77 docenv.makeConstructorDoc(meth, treePath); 77 docenv.makeConstructorDoc(meth, treePath);
78 else if (isAnnotationTypeElement(meth)) 78 else if (isAnnotationTypeElement(meth))
79 docenv.makeAnnotationTypeElementDoc(meth, treePath); 79 docenv.makeAnnotationTypeElementDoc(meth, treePath);
80 else 80 else
88 public void visitVarDef(JCVariableDecl tree) { 88 public void visitVarDef(JCVariableDecl tree) {
89 super.visitVarDef(tree); 89 super.visitVarDef(tree);
90 if (tree.sym != null && 90 if (tree.sym != null &&
91 tree.sym.kind == Kinds.VAR && 91 tree.sym.kind == Kinds.VAR &&
92 !isParameter(tree.sym)) { 92 !isParameter(tree.sym)) {
93 docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, tree)); 93 docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, env.enclClass, tree));
94 } 94 }
95 } 95 }
96 96
97 private static boolean isAnnotationTypeElement(MethodSymbol meth) { 97 private static boolean isAnnotationTypeElement(MethodSymbol meth) {
98 return ClassDocImpl.isAnnotationType(meth.enclClass()); 98 return ClassDocImpl.isAnnotationType(meth.enclClass());

mercurial