/** * <p> * copyOnWrite * </p> */ public void copyOnWrite() { if (trace.getProxyCount() > 1) { trace.removeProxy(); trace = trace.clone(); } }
/** * {@inheritDoc} * * Returns a copy of this trace where all MethodCall-information traced from * objects other then the one identified by the given objectID is removed * from the finished_calls-field * * WARNING: this will not affect this.true_distances and other fields of * ExecutionTrace this only affects the finished_calls field (which should * suffice for BranchCoverageFitness-calculation) */ @Override public ExecutionTrace getTraceForObject(int objectId) { ExecutionTraceImpl r = clone(); ArrayList<Integer> removableCalls = new ArrayList<Integer>(); for (int i = 0; i < r.finishedCalls.size(); i++) { MethodCall call = r.finishedCalls.get(i); if ((call.callingObjectID != objectId) && (call.callingObjectID != 0)) { removableCalls.add(i); } } removeFinishCalls(r, removableCalls); return new ExecutionTraceProxy(r); }
ExecutionTraceImpl r = clone(); Branch targetDUBranch = targetDU.getControlDependentBranch(); ArrayList<Integer> removableCalls = new ArrayList<Integer>();