public TryStmt(final BlockStmt tryBlock, final List<CatchClause> catchs, final BlockStmt finallyBlock) { setTryBlock(tryBlock); setCatchs(catchs); setFinallyBlock(finallyBlock); }
public TryStmt(final int beginLine, final int beginColumn, final int endLine, final int endColumn, List<VariableDeclarationExpr> resources, final BlockStmt tryBlock, final List<CatchClause> catchs, final BlockStmt finallyBlock) { super(beginLine, beginColumn, endLine, endColumn); this.resources = resources; setTryBlock(tryBlock); setCatchs(catchs); setFinallyBlock(finallyBlock); }
@Override public Node visit(final TryStmt n, final A arg) { n.setTryBlock((BlockStmt) n.getTryBlock().accept(this, arg)); final List<CatchClause> catchs = n.getCatchs(); if (catchs != null) { for (int i = 0; i < catchs.size(); i++) { catchs.set(i, (CatchClause) catchs.get(i).accept(this, arg)); } removeNulls(catchs); } if (n.getFinallyBlock() != null) { n.setFinallyBlock((BlockStmt) n.getFinallyBlock().accept(this, arg)); } return n; }