Beispiel #1
0
 public void visitMethodDef(MethodDef tree) {
   super.visitMethodDef(tree);
   MethodSymbol meth = (MethodSymbol) tree.sym;
   if (meth == null || meth.kind != Kinds.MTH) return;
   String docComment = env.toplevel.docComments.get(tree);
   if (meth.isConstructor()) docenv.makeConstructorDoc(meth, docComment, tree);
   else if (isAnnotationTypeElement(meth))
     docenv.makeAnnotationTypeElementDoc(meth, docComment, tree);
   else docenv.makeMethodDoc(meth, docComment, tree);
 }
  @Override
  public void visitMethodDef(JCMethodDecl tree) {
    super.visitMethodDef(tree);
    MethodSymbol meth = tree.sym;
    if (meth == null || meth.kind != Kinds.MTH) return;
    TreePath treePath = docenv.getTreePath(env.toplevel, env.enclClass, tree);
    if (meth.isConstructor()) docenv.makeConstructorDoc(meth, treePath);
    else if (isAnnotationTypeElement(meth)) docenv.makeAnnotationTypeElementDoc(meth, treePath);
    else docenv.makeMethodDoc(meth, treePath);

    // release resources
    tree.body = null;
  }