/**
  * Adds the given argument to the method call. The list of arguments will be initialized if it is
  * <code>null</code>.
  *
  * @param call method call
  * @param arg argument value
  */
 public static void addArgument(MethodCallExpr call, Expression arg) {
   List<Expression> args = call.getArgs();
   if (args == null) {
     args = new ArrayList<Expression>();
     call.setArgs(args);
   }
   args.add(arg);
 }
Ejemplo n.º 2
0
 public void visit(MethodCallExpr n, Object arg) {
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
   }
   printTypeArgs(n.getTypeArgs(), arg);
   if (n.getArgs() != null) {
     for (Iterator<Expression> i = n.getArgs().iterator(); i.hasNext(); ) {
       Expression e = i.next();
       e.accept(this, arg);
       if (i.hasNext()) {}
     }
   }
 }
 public void visit(MethodCallExpr n, A arg) {
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
   }
   if (n.getTypeArgs() != null) {
     for (Type t : n.getTypeArgs()) {
       t.accept(this, arg);
     }
   }
   if (n.getArgs() != null) {
     for (Expression e : n.getArgs()) {
       e.accept(this, arg);
     }
   }
 }