Program: 183926
Project: 183926
Buggy source:
/** 
 * analyze, as its name suggests, analyzes a RevisionNode list and finds helpful data on the revisions as a whole data found includes: max/min/average relevance rating max/min/average number of files changed i a revision average number of relevant files file groupings
 */
public void analyze(){
  String previousRev="String_Node_Str";
  Iterator<RevisionNode> runThrough=toAnalyze.iterator();
  RevisionNode next=null;
  while (runThrough.hasNext()) {
    next=runThrough.next();
    revisions[toAnalyze.indexOf(next)]="String_Node_Str" + next.getRevision();
    relevants[toAnalyze.indexOf(next)]=Integer.toString(next.getNumberOfRelevants());
    irrelevants[toAnalyze.indexOf(next)]=Integer.toString(next.getTotalChanges() - next.getNumberOfRelevants());
    ratings[toAnalyze.indexOf(next)]=Double.toString(next.getRating());
    Calendar thisTime=new GregorianCalendar(Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[1]) - 1,Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[2]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[1]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[2]));
    if (highestRating == -1) {
      lastTime=new GregorianCalendar(Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[1]) - 1,Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[2]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[1]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[2]));
      now="String_Node_Str" + next.getRevision() + "String_Node_Str"+ next.getDate()+ "String_Node_Str";
      previousRev=next.getRevision();
    }
 else {
      long timeDiff=lastTime.getTimeInMillis() - thisTime.getTimeInMillis();
      flowOfTime[toAnalyze.indexOf(next) - 1]=Long.toString(timeDiff / 1000 / 60/ 60);
      revisionsToo[toAnalyze.indexOf(next) - 1]=next.getRevision() + "String_Node_Str" + previousRev;
      if (timeDiff > timeDiffHigh) {
        timeDiffHigh=timeDiff;
        revisionReference[4]=next.getRevision() + "String_Node_Str" + previousRev;
      }
      if (timeDiff < timeDiffLow) {
        timeDiffLow=timeDiff;
        revisionReference[5]=next.getRevision() + "String_Node_Str" + previousRev;
      }
      timeDiffAverage+=timeDiff;
      lastTime=thisTime;
    }
    relevantPresent[next.getNumberOfRelevants() - 1]+=1;
    if ((next.getTotalChanges() - next.getNumberOfRelevants()) < (10 * next.getNumberOfRelevants())) {
      irrelevantPresent[next.getNumberOfRelevants() - 1]+=1;
    }
    String files="String_Node_Str";
    Iterator<String> listIt=next.getRelevantFiles().iterator();
    while (listIt.hasNext()) {
      String nextFile=listIt.next();
      nextFile=nextFile.substring(nextFile.lastIndexOf('/') + 1);
      if (listIt.hasNext()) {
        files+=nextFile + "String_Node_Str";
      }
 else {
        files+=nextFile;
      }
    }
    grouping.newInput(files);
    relevantAverage+=next.getNumberOfRelevants();
    ratingAverage+=next.getRating();
    nFilesAverage+=next.getTotalChanges();
    if (next.getRating() > highestRating) {
      highestRating=next.getRating() * 100000;
      highestRating=Math.round(highestRating);
      highestRating/=100000;
      revisionReference[0]=next.getRevision();
    }
    if (next.getRating() < lowestRating) {
      lowestRating=next.getRating() * 100000;
      lowestRating=Math.round(lowestRating);
      lowestRating/=100000;
      revisionReference[1]=next.getRevision();
    }
    if (next.getTotalChanges() > highestFileNumber) {
      highestFileNumber=next.getTotalChanges();
      revisionReference[2]=next.getRevision();
    }
    if (next.getTotalChanges() < lowestFileNumber) {
      lowestFileNumber=next.getTotalChanges();
      revisionReference[3]=next.getRevision();
    }
    previousRev=next.getRevision();
  }
  if (next != null) {
    then="String_Node_Str" + next.getRevision() + "String_Node_Str"+ next.getDate()+ "String_Node_Str";
    ratingAverage=(ratingAverage / revisionTotal) * 100000;
    ratingAverage=Math.round(ratingAverage);
    ratingAverage/=100000;
    nFilesAverage=nFilesAverage / revisionTotal;
    relevantAverage=relevantAverage / revisionTotal;
    timeDiffAverage=(((timeDiffAverage / (revisionTotal - 1)) / 1000) / 60) / 60;
  }
}

Fixed version (ground truth):
/** 
 * analyze, as its name suggests, analyzes a RevisionNode list and finds helpful data on the revisions as a whole data found includes: max/min/average relevance rating max/min/average number of files changed i a revision average number of relevant files file groupings
 */
public void analyze(){
  String previousRev="String_Node_Str";
  Iterator<RevisionNode> runThrough=toAnalyze.iterator();
  RevisionNode next=null;
  while (runThrough.hasNext()) {
    next=runThrough.next();
    revisions[toAnalyze.indexOf(next)]="String_Node_Str" + next.getRevision();
    relevants[toAnalyze.indexOf(next)]=Integer.toString(next.getNumberOfRelevants());
    if (next.getTotalChanges() - next.getNumberOfRelevants() >= 0) {
      irrelevants[toAnalyze.indexOf(next)]=Integer.toString(next.getTotalChanges() - next.getNumberOfRelevants());
    }
 else {
      irrelevants[toAnalyze.indexOf(next)]="String_Node_Str";
    }
    ratings[toAnalyze.indexOf(next)]=Double.toString(next.getRating());
    Calendar thisTime=new GregorianCalendar(Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[1]) - 1,Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[2]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[1]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[2]));
    if (highestRating == -1) {
      lastTime=new GregorianCalendar(Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[1]) - 1,Integer.parseInt(next.getDate().split("String_Node_Str")[0].split("String_Node_Str")[2]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[0]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[1]),Integer.parseInt(next.getDate().split("String_Node_Str")[1].split("String_Node_Str")[2]));
      now="String_Node_Str" + next.getRevision() + "String_Node_Str"+ next.getDate()+ "String_Node_Str";
      previousRev=next.getRevision();
    }
 else {
      long timeDiff=lastTime.getTimeInMillis() - thisTime.getTimeInMillis();
      flowOfTime[toAnalyze.indexOf(next) - 1]=Long.toString(timeDiff / 1000 / 60/ 60);
      revisionsToo[toAnalyze.indexOf(next) - 1]=next.getRevision() + "String_Node_Str" + previousRev;
      if (timeDiff > timeDiffHigh) {
        timeDiffHigh=timeDiff;
        revisionReference[4]=next.getRevision() + "String_Node_Str" + previousRev;
      }
      if (timeDiff < timeDiffLow) {
        timeDiffLow=timeDiff;
        revisionReference[5]=next.getRevision() + "String_Node_Str" + previousRev;
      }
      timeDiffAverage+=timeDiff;
      lastTime=thisTime;
    }
    relevantPresent[next.getNumberOfRelevants() - 1]+=1;
    if ((next.getTotalChanges() - next.getNumberOfRelevants()) < (10 * next.getNumberOfRelevants())) {
      irrelevantPresent[next.getNumberOfRelevants() - 1]+=1;
    }
    String files="String_Node_Str";
    Iterator<String> listIt=next.getRelevantFiles().iterator();
    while (listIt.hasNext()) {
      String nextFile=listIt.next();
      nextFile=nextFile.substring(nextFile.lastIndexOf('/') + 1);
      if (listIt.hasNext()) {
        files+=nextFile + "String_Node_Str";
      }
 else {
        files+=nextFile;
      }
    }
    grouping.newInput(files);
    relevantAverage+=next.getNumberOfRelevants();
    ratingAverage+=next.getRating();
    nFilesAverage+=next.getTotalChanges();
    if (next.getRating() > highestRating) {
      highestRating=next.getRating() * 100000;
      highestRating=Math.round(highestRating);
      highestRating/=100000;
      revisionReference[0]=next.getRevision();
    }
    if (next.getRating() < lowestRating) {
      lowestRating=next.getRating() * 100000;
      lowestRating=Math.round(lowestRating);
      lowestRating/=100000;
      revisionReference[1]=next.getRevision();
    }
    if (next.getTotalChanges() > highestFileNumber) {
      highestFileNumber=next.getTotalChanges();
      revisionReference[2]=next.getRevision();
    }
    if (next.getTotalChanges() < lowestFileNumber) {
      lowestFileNumber=next.getTotalChanges();
      revisionReference[3]=next.getRevision();
    }
    previousRev=next.getRevision();
  }
  if (next != null) {
    then="String_Node_Str" + next.getRevision() + "String_Node_Str"+ next.getDate()+ "String_Node_Str";
    ratingAverage=(ratingAverage / revisionTotal) * 100000;
    ratingAverage=Math.round(ratingAverage);
    ratingAverage/=100000;
    nFilesAverage=nFilesAverage / revisionTotal;
    relevantAverage=relevantAverage / revisionTotal;
    timeDiffAverage=(((timeDiffAverage / (revisionTotal - 1)) / 1000) / 60) / 60;
  }
}