Program: 50691
Project: 50691
Buggy source:
public static void main(String[] args) throws IOException, GitAPIException, IncorrectTraceException, PreconditionException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (args.length < 1) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  String gitdir=args[0];
  List<String> paths=new LinkedList<String>();
  if (args.length > 1 && !args[1].startsWith("String_Node_Str") && !args[1].matches("String_Node_Str")) {
    paths.add(args[1]);
  }
 else {
    extractFiles(new File(gitdir),gitdir,paths);
  }
  int end=paths.size();
  boolean save=Arrays.asList(args).contains("String_Node_Str");
  boolean clean=Arrays.asList(args).contains("String_Node_Str");
  System.out.println("String_Node_Str" + paths.size());
  String file=getNameFile(args);
  writeTofile(file,"String_Node_Str");
  int nbrExec=Integer.parseInt(args[args.length - 2]);
  Factory<CRDT> rf=(Factory<CRDT>)Class.forName(args[args.length - 1]).newInstance();
  int nb=(nbrExec > 1) ? nbrExec + 1 : nbrExec;
  boolean calculTimeEx=true;
  int i=0;
  CouchConnector cc=new CouchConnector(dbURL);
  for (  String path : paths.subList(i,end)) {
    for (int retry=0; retry < 10; ++retry) {
      try {
        long ltime[][]=null, mem[][]=null, rtime[][]=null;
        int cop=0, uop=0, nbReplica=0, mop=0;
        int minCop=0, minUop=0, minMop=0;
        String stat="String_Node_Str";
        GitTrace trace=GitTrace.create(gitdir,cc,path,clean);
        for (int k=0; k < nbrExec; k++) {
          CausalSimulator cd=new CausalSimulator(rf);
          cd.run(trace,calculTimeEx,true,100,true);
          if (k == 0) {
            cop=cd.splittedGenTime().size();
            uop=cd.replicaGenerationTimes().size();
            mop=cd.getMemUsed().size();
            nbReplica=cd.replicas.keySet().size();
            ltime=new long[nb][uop];
            rtime=new long[nb][cop];
            mem=new long[nb][mop];
            minCop=cop;
            minUop=uop;
            minMop=mop;
            stat=path + ';' + ++i+ ';'+ cd.replicas.keySet().size()+ ';'+ trace.nbMerge+ ';'+ trace.nbBlockMerge+ ';'+ trace.mergeSize+ ';'+ trace.nbCommit+ ';'+ trace.nbInsBlock+ ';'+ trace.nbDelBlock+ ';'+ trace.nbUpdBlock+ ';'+ trace.insertSize+ ';'+ trace.deleteSize;
          }
          if (nbReplica == 0) {
            break;
          }
          if (minCop > cd.splittedGenTime().size()) {
            minCop=cd.splittedGenTime().size();
          }
          if (minUop > cd.replicaGenerationTimes().size()) {
            minUop=cd.replicaGenerationTimes().size();
          }
          if (calculTimeEx) {
            toArrayLong(ltime[k],cd.replicaGenerationTimes(),minUop);
            toArrayLong(rtime[k],cd.splittedGenTime(),minCop);
          }
          if (k == 0) {
            toArrayLong(mem[k],cd.getMemUsed(),minMop);
          }
          for (int j=0; j < minCop - 1; j++) {
            if (nbReplica > 1)             rtime[k][j]/=nbReplica - 1;
          }
          cd=null;
        }
        System.out.println(path + "String_Node_Str" + i);
        double thresold=2.0;
        if (nbrExec > 1) {
          computeAverage(ltime,thresold,minUop);
          computeAverage(rtime,thresold,minCop);
        }
        long avgGen=calculAvg(ltime,minUop,"String_Node_Str");
        long avgUsr=calculAvg(rtime,minCop,"String_Node_Str");
        long avgMem=calculAvg(mem,minMop,"String_Node_Str");
        stat=stat + ';' + minCop+ ';'+ avgGen / 1000 + ';' + avgUsr / 1000 + ';' + avgMem;
        writeTofile(file,stat);
        break;
      }
 catch (      DbAccessException e) {
        if (retry == 9) {
          throw e;
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, GitAPIException, IncorrectTraceException, PreconditionException, ClassNotFoundException, InstantiationException, IllegalAccessException {
  if (args.length < 1) {
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.err.println("String_Node_Str");
    System.exit(1);
  }
  String gitdir=args[0];
  List<String> paths=new LinkedList<String>();
  if (args.length > 1 && !args[1].startsWith("String_Node_Str") && !args[1].matches("String_Node_Str")) {
    paths.add(args[1]);
  }
 else {
    extractFiles(new File(gitdir),gitdir,paths);
  }
  int end=paths.size();
  boolean save=Arrays.asList(args).contains("String_Node_Str");
  boolean clean=Arrays.asList(args).contains("String_Node_Str");
  System.out.println("String_Node_Str" + paths.size());
  String file=getNameFile(args);
  if (save) {
    writeTofile(file,"String_Node_Str");
  }
  int nbrExec=Integer.parseInt(args[args.length - 2]);
  Factory<CRDT> rf=(Factory<CRDT>)Class.forName(args[args.length - 1]).newInstance();
  int nb=(nbrExec > 1) ? nbrExec + 1 : nbrExec;
  boolean calculTimeEx=true;
  int i=0;
  CouchConnector cc=new CouchConnector(dbURL);
  for (  String path : paths.subList(i,end)) {
    long ltime[][]=null, mem[][]=null, rtime[][]=null;
    int cop=0, uop=0, nbReplica=0, mop=0;
    int minCop=0, minUop=0, minMop=0;
    String stat="String_Node_Str";
    GitTrace trace=GitTrace.create(gitdir,cc,path,clean);
    for (int k=0; k < nbrExec; k++) {
      CausalSimulator cd=new CausalSimulator(rf);
      cd.run(trace,calculTimeEx,save,100,save);
      if (k == 0) {
        cop=cd.splittedGenTime().size();
        uop=cd.replicaGenerationTimes().size();
        mop=cd.getMemUsed().size();
        nbReplica=cd.replicas.keySet().size();
        ltime=new long[nb][uop];
        rtime=new long[nb][cop];
        mem=new long[nb][mop];
        minCop=cop;
        minUop=uop;
        minMop=mop;
        stat=path + ';' + ++i+ ';'+ cd.replicas.keySet().size()+ ';'+ trace.nbMerge+ ';'+ trace.nbBlockMerge+ ';'+ trace.mergeSize+ ';'+ trace.nbCommit+ ';'+ trace.nbInsBlock+ ';'+ trace.nbDelBlock+ ';'+ trace.nbUpdBlock+ ';'+ trace.insertSize+ ';'+ trace.deleteSize;
      }
      if (nbReplica == 0 || !save) {
        break;
      }
      if (minCop > cd.splittedGenTime().size()) {
        minCop=cd.splittedGenTime().size();
      }
      if (minUop > cd.replicaGenerationTimes().size()) {
        minUop=cd.replicaGenerationTimes().size();
      }
      if (calculTimeEx) {
        toArrayLong(ltime[k],cd.replicaGenerationTimes(),minUop);
        toArrayLong(rtime[k],cd.splittedGenTime(),minCop);
      }
      if (k == 0) {
        toArrayLong(mem[k],cd.getMemUsed(),minMop);
      }
      for (int j=0; j < minCop - 1; j++) {
        if (nbReplica > 1) {
          rtime[k][j]/=nbReplica - 1;
        }
      }
      cd=null;
    }
    System.out.println(stat);
    double thresold=2.0;
    if (save) {
      if (nbrExec > 1) {
        computeAverage(ltime,thresold,minUop);
        computeAverage(rtime,thresold,minCop);
      }
      long avgGen=calculAvg(ltime,minUop,"String_Node_Str");
      long avgUsr=calculAvg(rtime,minCop,"String_Node_Str");
      long avgMem=calculAvg(mem,minMop,"String_Node_Str");
      stat=stat + ';' + minCop+ ';'+ avgGen / 1000 + ';' + avgUsr / 1000 + ';' + avgMem;
      writeTofile(file,stat);
    }
  }
}