private CtMethod<?> apply(CtMethod<?> method, CtInvocation<?> invocation) { final CtInvocation<?> invocationToBeInserted = invocation.clone(); final CtStatement insertionPoint = this.getRightInsertionPoint(invocation); insertionPoint.insertBefore(invocationToBeInserted); final CtMethod<?> clone = CloneHelper.cloneTestMethodForAmp(method, "_add"); AmplifierHelper.getParent(invocationToBeInserted).getStatements().remove(invocationToBeInserted); Counter.updateInputOf(clone, 1); return clone; }
invocation.getType(), "__DSPOT_invoc_" + indexOfInvocation, invocation.clone()); CtExpression<?> target = AmplifierHelper.createLocalVarRef(localVar); CtMethod methodClone = CloneHelper.cloneTestMethodForAmp(testMethod, ""); // no need to suffix here, since it will be recloned after that
&& anotherMethod.getParameters().equals(affectedMethod.getParameters())) { CtInvocation newInvocation = invocationToReplace.clone();
CtExpression expCloned = invocationToReplace.clone(); expCloned.setPosition(new NoSourcePosition()); MutationSupporter.clearPosition(expCloned);
} else { final CtLocalVariable localVariable = stmt.getFactory().createLocalVariable(invocation.getType(), "o_" + id, invocation.clone()); try { stmt.replace(localVariable); CtInvocation invocationToObjectLogAtTheEnd = invocationToObjectLog.clone(); invocationToObjectLogAtTheEnd.addArgument(stmt.getFactory().createLiteral(id + "___" + "end")); invocationToObjectLog.addArgument(stmt.getFactory().createLiteral(id));