Program: 50689
Project: 50689
Buggy source:
@Override public void run(Trace trace,boolean detail,boolean saveTrace,int nbrTrace,boolean o) throws IncorrectTraceException, PreconditionException, IOException {
  this.detail=detail;
  this.nbrTrace=nbrTrace;
  overhead=o;
  long tmp;
  final Map<Integer,VectorClock> clocks=new HashMap<Integer,VectorClock>();
  final VectorClock globalClock=new VectorClock();
  final List<TraceOperation> concurrentOps=new LinkedList<TraceOperation>();
  final Enumeration<TraceOperation> it=trace.enumeration();
  orderTrace=new HashMap();
  int numTrace=0;
  if (saveTrace) {
    writer=new ObjectOutputStream(new FileOutputStream("String_Node_Str"));
  }
  setOp=new HashSet();
  history=new HashMap<Integer,List<TraceOperation>>();
  genHistory=new HashMap<Integer,List<CRDTMessage>>();
  while (it.hasMoreElements()) {
    tour++;
    final TraceOperation opt=it.nextElement();
    final int r=opt.getReplica();
    CRDT localReplica=this.getReplicas().get(r);
    if (localReplica == null) {
      localReplica=this.newReplica(r);
      clocks.put(r,new VectorClock());
      genHistory.put(r,new ArrayList<CRDTMessage>());
      history.put(r,new ArrayList<TraceOperation>());
    }
    VectorClock vc=clocks.get(r);
    if (!vc.readyFor(r,opt.getVectorClock())) {
      Iterator<Integer> i=opt.getVectorClock().keySet().iterator();
      concurrentOps.clear();
      while (i.hasNext()) {
        int e=i.next();
        if (e != r) {
          for (int j=opt.getVectorClock().get(e); j > vc.getSafe(e); j--) {
            insertCausalOrder(concurrentOps,history.get(e).get(j - 1));
          }
        }
      }
      play(localReplica,vc,concurrentOps);
    }
    LocalOperation op=opt.getOperation();
    op=op.adaptTo(localReplica);
    if (saveTrace) {
      storeOp(opt);
    }
    history.get(r).add(opt);
    if (detail) {
      orderTrace.put(opt,numTrace++);
    }
    if (!vc.readyFor(r,opt.getVectorClock())) {
      throw new IncorrectTraceException("String_Node_Str" + r + "String_Node_Str"+ vc+ "String_Node_Str"+ opt.getVectorClock());
    }
    tmp=System.nanoTime();
    final CRDTMessage m=localReplica.applyLocal(op);
    long after=System.nanoTime();
    localSum+=(after - tmp);
    if (detail) {
      genTime.add(after - tmp);
      genSize.add(m.size());
      remoteTime.add(0L);
    }
    nbLocal++;
    final CRDTMessage msg=m.clone();
    genHistory.get(r).add(msg);
    clocks.get(r).inc(r);
    globalClock.inc(r);
    ifSerializ();
  }
  ifSerializ();
  for (  CRDT r : replicas.values()) {
    int n=r.getReplicaNumber();
    concurrentOps.clear();
    VectorClock vc=clocks.get(n);
    for (    Entry<Integer,Integer> e : globalClock.entrySet()) {
      for (int j=vc.getSafe(e.getKey()); j < e.getValue(); ++j) {
        insertCausalOrder(concurrentOps,history.get(e.getKey()).get(j));
      }
    }
    play(r,vc,concurrentOps);
  }
  if (writer != null) {
    writer.close();
  }
}

Fixed version (ground truth):
@Override public void run(Trace trace,boolean detail,boolean saveTrace,int nbrTrace,boolean overhead) throws IncorrectTraceException, PreconditionException, IOException {
  this.detail=detail;
  this.nbrTrace=nbrTrace;
  this.overhead=overhead;
  long tmp;
  final Map<Integer,VectorClock> clocks=new HashMap<Integer,VectorClock>();
  final VectorClock globalClock=new VectorClock();
  final List<TraceOperation> concurrentOps=new LinkedList<TraceOperation>();
  final Enumeration<TraceOperation> it=trace.enumeration();
  orderTrace=new HashMap();
  int numTrace=0;
  if (saveTrace) {
    writer=new ObjectOutputStream(new FileOutputStream("String_Node_Str"));
  }
  setOp=new HashSet();
  history=new HashMap<Integer,List<TraceOperation>>();
  genHistory=new HashMap<Integer,List<CRDTMessage>>();
  while (it.hasMoreElements()) {
    tour++;
    final TraceOperation opt=it.nextElement();
    final int r=opt.getReplica();
    CRDT localReplica=this.getReplicas().get(r);
    if (localReplica == null) {
      localReplica=this.newReplica(r);
      clocks.put(r,new VectorClock());
      genHistory.put(r,new ArrayList<CRDTMessage>());
      history.put(r,new ArrayList<TraceOperation>());
    }
    VectorClock vc=clocks.get(r);
    if (!vc.readyFor(r,opt.getVectorClock())) {
      Iterator<Integer> i=opt.getVectorClock().keySet().iterator();
      concurrentOps.clear();
      while (i.hasNext()) {
        int e=i.next();
        if (e != r) {
          for (int j=opt.getVectorClock().get(e); j > vc.getSafe(e); j--) {
            insertCausalOrder(concurrentOps,history.get(e).get(j - 1));
          }
        }
      }
      play(localReplica,vc,concurrentOps);
    }
    LocalOperation op=opt.getOperation();
    op=op.adaptTo(localReplica);
    if (saveTrace) {
      storeOp(opt);
    }
    history.get(r).add(opt);
    if (detail) {
      orderTrace.put(opt,numTrace++);
    }
    if (!vc.readyFor(r,opt.getVectorClock())) {
      throw new IncorrectTraceException("String_Node_Str" + r + "String_Node_Str"+ vc+ "String_Node_Str"+ opt.getVectorClock());
    }
    tmp=System.nanoTime();
    final CRDTMessage m=localReplica.applyLocal(op);
    long after=System.nanoTime();
    localSum+=(after - tmp);
    if (detail) {
      genTime.add(after - tmp);
      genSize.add(m.size());
      remoteTime.add(0L);
    }
    nbLocal++;
    final CRDTMessage msg=m.clone();
    genHistory.get(r).add(msg);
    clocks.get(r).inc(r);
    globalClock.inc(r);
    ifSerializ();
  }
  ifSerializ();
  for (  CRDT r : replicas.values()) {
    int n=r.getReplicaNumber();
    concurrentOps.clear();
    VectorClock vc=clocks.get(n);
    for (    Entry<Integer,Integer> e : globalClock.entrySet()) {
      for (int j=vc.getSafe(e.getKey()); j < e.getValue(); ++j) {
        insertCausalOrder(concurrentOps,history.get(e.getKey()).get(j));
      }
    }
    play(r,vc,concurrentOps);
  }
  if (writer != null) {
    writer.close();
  }
}