private ExecutionTracer() { trace = new ExecutionTraceProxy(); }
/** {@inheritDoc} */ @Override public void finishCalls() { copyOnWrite(); trace.finishCalls(); }
/** {@inheritDoc} */ @Override public void definitionPassed(Object object, Object caller, int defID) { copyOnWrite(); trace.definitionPassed(object, caller, defID); }
/** * Reset for new execution */ public void clear() { trace = new ExecutionTraceProxy(); BooleanHelper.clearStack(); num_statements = 0; }
/** {@inheritDoc} */ @Override public void returnValue(String className, String methodName, int value) { copyOnWrite(); trace.returnValue(className, methodName, value); }
/** {@inheritDoc} */ @Override public ExecutionTrace lazyClone() { ExecutionTraceProxy copy = new ExecutionTraceProxy(trace); trace.addProxy(); return copy; }
/** {@inheritDoc} */ @Override public void enteredMethod(String className, String methodName, Object caller) { copyOnWrite(); trace.enteredMethod(className, methodName, caller); }
/** * {@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); }
/** {@inheritDoc} */ @Override public void setExplicitException(Throwable explicitException) { copyOnWrite(); trace.setExplicitException(explicitException); }
return new ExecutionTraceProxy(r);
/** {@inheritDoc} */ @Override public void usePassed(Object object, Object caller, int useID) { copyOnWrite(); trace.usePassed(object, caller, useID); }
/** {@inheritDoc} */ @Override public void clear() { copyOnWrite(); trace.clear(); }
/** {@inheritDoc} */ @Override public void exitMethod(String classname, String methodname) { copyOnWrite(); trace.exitMethod(classname, methodname); }
/** {@inheritDoc} */ @Override public void branchPassed(int branch, int bytecode_id, double true_distance, double false_distance) { copyOnWrite(); trace.branchPassed(branch, bytecode_id, true_distance, false_distance); }
/** {@inheritDoc} */ @Override public void linePassed(String className, String methodName, int line) { copyOnWrite(); trace.linePassed(className, methodName, line); }
/** {@inheritDoc} */ @Override public void mutationPassed(int mutationId, double distance) { copyOnWrite(); trace.mutationPassed(mutationId, distance); }