/* * @see ASTVisitor#visit(TryStatement) */ @Override public boolean visit(TryStatement node) { this.fBuffer.append("try "); // $NON-NLS-1$ if (node.getAST().apiLevel() >= JLS4) { if (!node.resources().isEmpty()) { this.fBuffer.append("("); // $NON-NLS-1$ for (Iterator<VariableDeclarationExpression> it = node.resources().iterator(); it.hasNext(); ) { VariableDeclarationExpression var = it.next(); var.accept(this); if (it.hasNext()) { this.fBuffer.append(","); // $NON-NLS-1$ } } this.fBuffer.append(") "); // $NON-NLS-1$ } } node.getBody().accept(this); this.fBuffer.append(" "); // $NON-NLS-1$ for (Iterator<CatchClause> it = node.catchClauses().iterator(); it.hasNext(); ) { CatchClause cc = it.next(); cc.accept(this); } if (node.getFinally() != null) { this.fBuffer.append("finally "); // $NON-NLS-1$ node.getFinally().accept(this); } return false; }
/* * @see ASTVisitor#visit(TryStatement) */ public boolean visit(TryStatement node) { this.fBuffer.append("try "); // $NON-NLS-1$ node.getBody().accept(this); this.fBuffer.append(" "); // $NON-NLS-1$ for (Iterator it = node.catchClauses().iterator(); it.hasNext(); ) { CatchClause cc = (CatchClause) it.next(); cc.accept(this); } if (node.getFinally() != null) { this.fBuffer.append("finally "); // $NON-NLS-1$ node.getFinally().accept(this); } return false; }