private void tryToRemoveAssertion(CtMethod<?> amplifiedTestToBeMinimized, CtInvocation<?> invocation, Failure failureToKeep) { final CtMethod<?> clone = amplifiedTestToBeMinimized.clone(); clone.getBody().removeStatement(invocation); if (checkIfMinimizationIsOk(clone, failureToKeep)) { amplifiedTestToBeMinimized.getBody().removeStatement(invocation); } }
private void tryToRemoveAssertion(CtMethod<?> amplifiedTestToBeMinimized, CtInvocation<?> invocation, Failure failureToKeep) { final CtMethod<?> clone = amplifiedTestToBeMinimized.clone(); clone.getBody().removeStatement(invocation); if (checkIfMinimizationIsOk(clone, failureToKeep)) { amplifiedTestToBeMinimized.getBody().removeStatement(invocation); } }
@SuppressWarnings({ "static-access", "unchecked", "rawtypes" }) private void writeCondition(String type, CtBlock parent, int id) { CtExpression conditionExp = ExpressionGenerator.fetchEXP(this.mutSupporter, this.modificationPoint, type, querytype); CtIf ifStmt = this.mutSupporter.getFactory().Core().createIf(); ifStmt.setCondition(conditionExp); ifStmt.setThenStatement((CtStatement)this.modificationPoint.getCodeElement()); parent.addStatement(id, ifStmt); parent.removeStatement((CtStatement)this.modificationPoint.getCodeElement()); saveSketchAndSynthesize(); parent.addStatement(id, (CtStatement)this.modificationPoint.getCodeElement()); parent.removeStatement(ifStmt); resoreDiskFile(); }
testDownAfterClass.getBody().removeStatement((CtStatement) addedElement);
@Override public boolean undoChangesInModel(OperatorInstance operation, ProgramVariant p) { StatementOperatorInstance stmtoperator = (StatementOperatorInstance) operation; CtStatement ctst = (CtStatement) operation.getOriginal(); CtStatement fix = (CtStatement) operation.getModified(); CtBlock<?> parentBlock = stmtoperator.getParentBlock(); if (parentBlock != null) { if (fix instanceof CtBlock) { CtBlock movedBlock = (CtBlock) fix; CtStatement firstFromBlock = movedBlock.getStatement(0); firstFromBlock.replace((CtStatement) ctst); for (CtStatement s : movedBlock.getStatements()) { parentBlock.removeStatement(s); } return true; } else { fix.replace((CtStatement) ctst); return true; } } return false; }
parent.removeStatement(ifstmt); resoreDiskFile();
c.getBody().removeStatement(firstStmt); List<CtStatement> superConstructorBodyStatements = superConstructorBody.getStatements();