Program: 44685
Project: 44685
Buggy source:
/** 
 * @param seq
 * @return
 */
public static GeneSequence linearPrimerDesignAlgo(GeneSequence seq){
  int[] primerIndices=new int[4];
  ArrayList<Integer> internalChanges=seq.changes;
  int primerDesignCount;
  int pivotChange;
  int currentChangeIndex;
  boolean tooFar;
  System.out.println("String_Node_Str" + internalChanges.size());
  for (int i=0; i < internalChanges.size(); i++) {
    if (internalChanges.get(i) != -1) {
      for (int j=0; j < 4; j++) {
        primerIndices[j]=-1;
      }
      tooFar=false;
      pivotChange=internalChanges.get(i);
      primerDesignCount=0;
      primerIndices[primerDesignCount]=pivotChange;
      System.out.println("String_Node_Str" + pivotChange);
      if (i < internalChanges.size() - 1) {
        currentChangeIndex=i + 1;
        while (tooFar == false && currentChangeIndex < internalChanges.size()) {
          if (internalChanges.get(currentChangeIndex) - pivotChange <= 25 && primerDesignCount < 3) {
            primerDesignCount++;
            primerIndices[primerDesignCount]=internalChanges.get(currentChangeIndex);
            currentChangeIndex++;
            System.out.println("String_Node_Str" + primerIndices[primerDesignCount]);
          }
 else {
            tooFar=true;
          }
        }
      }
      Primer tempPrimer;
      for (int verifyIndex=primerDesignCount; verifyIndex >= 0; verifyIndex--) {
        tempPrimer=fakeDesignPrimer(primerIndices,primerDesignCount + 1);
        if (tempPrimer != null) {
          seq.addPrimer(tempPrimer);
          for (int clearIndex=i; clearIndex < i + verifyIndex + 1; clearIndex++) {
            internalChanges.set(clearIndex,-1);
          }
          break;
        }
 else {
          if (verifyIndex == 0) {
          }
          primerIndices[verifyIndex]=-1;
        }
      }
    }
  }
  seq.changes=internalChanges;
  for (int i=0; i < seq.primers.size(); i++) {
    System.out.println(seq.primers.get(i).getTopSequence());
  }
  String remainingChanges="String_Node_Str";
  for (int i=0; i < seq.changes.size(); i++) {
    remainingChanges+=seq.changes.get(i);
    remainingChanges+="String_Node_Str";
  }
  System.out.println(remainingChanges);
  return seq;
}

Fixed version (ground truth):
/** 
 * @param seq
 * @return
 */
public static GeneSequence linearPrimerDesignAlgo(GeneSequence seq){
  int[] primerIndices=new int[4];
  ArrayList<Integer> internalChanges=seq.changes;
  int primerDesignCount;
  int pivotChange;
  int currentChangeIndex;
  boolean tooFar;
  System.out.println("String_Node_Str" + internalChanges.size());
  for (int i=0; i < internalChanges.size(); i++) {
    if (internalChanges.get(i) != -1) {
      for (int j=0; j < 4; j++) {
        primerIndices[j]=-1;
      }
      tooFar=false;
      pivotChange=internalChanges.get(i);
      primerDesignCount=0;
      primerIndices[primerDesignCount]=pivotChange;
      if (i < internalChanges.size() - 1) {
        currentChangeIndex=i + 1;
        while (tooFar == false && currentChangeIndex < internalChanges.size()) {
          if (internalChanges.get(currentChangeIndex) - pivotChange <= 25 && primerDesignCount < 3) {
            primerDesignCount++;
            primerIndices[primerDesignCount]=internalChanges.get(currentChangeIndex);
            currentChangeIndex++;
          }
 else {
            tooFar=true;
          }
        }
      }
      Primer tempPrimer;
      for (int verifyIndex=primerDesignCount; verifyIndex >= 0; verifyIndex--) {
        tempPrimer=fakeDesignPrimer(primerIndices,primerDesignCount + 1);
        if (tempPrimer != null) {
          seq.addPrimer(tempPrimer);
          for (int clearIndex=i; clearIndex < i + verifyIndex + 1; clearIndex++) {
            internalChanges.set(clearIndex,-1);
          }
          break;
        }
 else {
          if (verifyIndex == 0) {
          }
          primerIndices[verifyIndex]=-1;
        }
      }
    }
  }
  seq.changes=internalChanges;
  for (int i=0; i < seq.primers.size(); i++) {
    System.out.println(seq.primers.get(i).getTopSequence());
  }
  String remainingChanges="String_Node_Str";
  for (int i=0; i < seq.changes.size(); i++) {
    remainingChanges+=seq.changes.get(i);
    remainingChanges+="String_Node_Str";
  }
  System.out.println(remainingChanges);
  return seq;
}