@Override
 public void visit(final TryStmt n, final A arg) {
   visitComment(n.getComment(), arg);
   if (n.getResources() != null) {
     for (final VariableDeclarationExpr v : n.getResources()) {
       v.accept(this, arg);
     }
   }
   n.getTryBlock().accept(this, arg);
   if (n.getCatchs() != null) {
     for (final CatchClause c : n.getCatchs()) {
       c.accept(this, arg);
     }
   }
   if (n.getFinallyBlock() != null) {
     n.getFinallyBlock().accept(this, arg);
   }
 }
Exemplo n.º 2
0
  @Override
  public Boolean visit(final TryStmt n1, final Node arg) {
    final TryStmt n2 = (TryStmt) arg;

    if (!nodeEquals(n1.getTryBlock(), n2.getTryBlock())) {
      return Boolean.FALSE;
    }

    if (!nodesEquals(n1.getCatchs(), n2.getCatchs())) {
      return Boolean.FALSE;
    }

    if (!nodeEquals(n1.getFinallyBlock(), n2.getFinallyBlock())) {
      return Boolean.FALSE;
    }

    return Boolean.TRUE;
  }