Пример #1
0
  public void visit(MethodCall p) throws ParseTreeException {
    if (isSameObject(p, original_methodcall)) {
      Expression expr = p.getReferenceExpr();
      TypeName reftype = p.getReferenceType();

      if (expr != null) {
        if (expr instanceof Leaf
            || expr instanceof ArrayAccess
            || expr instanceof FieldAccess
            || expr instanceof MethodCall
            || expr instanceof Variable) {
          expr.accept(this);
        } else {
          writeParenthesis(expr);
        }
      } else if (reftype != null) {
        reftype.accept(this);
      }

      // -------------------------------------------------------------
      mutated_line = line_num;
      out.print(mutant);
      writeLog(
          removeNewline(
              p.toString()
                  + " =>  "
                  + p.toString().substring(0, p.toString().length() - ".clone()".length())));
      // -------------------------------------------------------------

    } else {
      super.visit(p);
    }
  }