Program: 101615
Project: 101615
Buggy source:
/** 
 * Find the differences between two texts.
 * @param text1 Old string to be diffed
 * @param text2 New string to be diffed
 * @param checkLines Speedup flag.  If false, then don't run aline-level diff first to identify the changed areas. If true, then run a faster slightly less optimal diff
 * @return List of Difference objects
 */
private List compute(){
  List diffs=new ArrayList();
  if (text1.equals("String_Node_Str")) {
    diffs.add(new Difference(EditType.INSERT,text2));
    return diffs;
  }
  if (text2.equals("String_Node_Str")) {
    diffs.add(new Difference(EditType.DELETE,text1));
    return diffs;
  }
  String longText=text1.length() > text2.length() ? text1 : text2;
  String shortText=text1.length() > text2.length() ? text2 : text1;
  int i=longText.indexOf(shortText);
  if (i != -1) {
    EditType editType=(text1.length() > text2.length()) ? EditType.DELETE : EditType.INSERT;
    diffs.add(new Difference(editType,longText.substring(0,i)));
    diffs.add(new Difference(EditType.EQUAL,shortText));
    diffs.add(new Difference(editType,longText.substring(i + shortText.length())));
    return diffs;
  }
  longText=null;
  shortText=null;
  CommonMiddle middleMatch=Commonality.halfMatch(text1,text2);
  if (middleMatch != null) {
    Diff startDiff=new Diff(middleMatch.getSourceStart(),middleMatch.getTargetStart(),checkLines);
    Diff endDiff=new Diff(middleMatch.getSourceEnd(),middleMatch.getTargetEnd(),checkLines);
    diffs=startDiff.compare();
    diffs.add(new Difference(EditType.EQUAL,middleMatch.getCommonality()));
    diffs.addAll(endDiff.compare());
    return diffs;
  }
  if (checkLines && text1.length() + text2.length() < 250) {
    checkLines=false;
  }
  LineMap lineMap=null;
  if (checkLines) {
    lineMap=new LineMap(text1,text2);
    text1=lineMap.getSourceMap();
    text2=lineMap.getTargetMap();
  }
  diffs=new DifferenceEngine(text1,text2).generate();
  if (diffs == null) {
    diffs=new ArrayList();
    diffs.add(new Difference(EditType.DELETE,text1));
    diffs.add(new Difference(EditType.INSERT,text2));
  }
  if (checkLines && lineMap != null) {
    lineMap.restore(diffs);
    DiffCleanup.cleanupSemantic(diffs);
    diffs.add(new Difference(EditType.EQUAL,"String_Node_Str"));
    int countDeletes=0;
    int countInserts=0;
    String textDelete="String_Node_Str";
    String textInsert="String_Node_Str";
    ListIterator pointer=diffs.listIterator();
    Difference curDiff=(Difference)pointer.next();
    while (curDiff != null) {
      EditType editType=curDiff.getEditType();
      if (EditType.INSERT.equals(editType)) {
        countInserts++;
        textInsert+=curDiff.getText();
      }
 else       if (EditType.DELETE.equals(editType)) {
        countDeletes++;
        textDelete+=curDiff.getText();
      }
 else {
        if (countDeletes >= 1 && countInserts >= 1) {
          pointer.previous();
          for (int j=0; j < countDeletes + countInserts; j++) {
            pointer.previous();
            pointer.remove();
          }
          Diff newDiff=new Diff(textDelete,textInsert,false);
          Iterator iter=newDiff.compare().iterator();
          while (iter.hasNext()) {
            pointer.add(iter.next());
          }
        }
        countInserts=0;
        countDeletes=0;
        textDelete="String_Node_Str";
        textInsert="String_Node_Str";
      }
      curDiff=pointer.hasNext() ? (Difference)pointer.next() : null;
    }
    diffs.remove(diffs.size() - 1);
  }
  return diffs;
}

Fixed version (ground truth):
/** 
 * Find the differences between two texts.
 * @param text1 Old string to be diffed
 * @param text2 New string to be diffed
 * @param checkLines Speedup flag.  If false, then don't run aline-level diff first to identify the changed areas. If true, then run a faster slightly less optimal diff
 * @return List of Difference objects
 */
private List compute(){
  List diffs=new ArrayList();
  if (text1.equals("String_Node_Str")) {
    diffs.add(new Difference(EditType.INSERT,text2));
    return diffs;
  }
  if (text2.equals("String_Node_Str")) {
    diffs.add(new Difference(EditType.DELETE,text1));
    return diffs;
  }
  String longText=text1.length() > text2.length() ? text1 : text2;
  String shortText=text1.length() > text2.length() ? text2 : text1;
  int i=longText.indexOf(shortText);
  if (i != -1) {
    EditType editType=(text1.length() > text2.length()) ? EditType.DELETE : EditType.INSERT;
    diffs.add(new Difference(editType,longText.substring(0,i)));
    diffs.add(new Difference(EditType.EQUAL,shortText));
    diffs.add(new Difference(editType,longText.substring(i + shortText.length())));
    return diffs;
  }
  longText=null;
  shortText=null;
  CommonMiddle middleMatch=Commonality.halfMatch(text1,text2);
  if (middleMatch != null) {
    Diff startDiff=new Diff(middleMatch.getSourcePrefix(),middleMatch.getTargetPrefix(),checkLines);
    Diff endDiff=new Diff(middleMatch.getSourceSuffix(),middleMatch.getTargetSuffix(),checkLines);
    diffs=startDiff.compare();
    diffs.add(new Difference(EditType.EQUAL,middleMatch.getCommonality()));
    diffs.addAll(endDiff.compare());
    return diffs;
  }
  if (checkLines && text1.length() + text2.length() < 250) {
    checkLines=false;
  }
  LineMap lineMap=null;
  if (checkLines) {
    lineMap=new LineMap(text1,text2);
    text1=lineMap.getSourceMap();
    text2=lineMap.getTargetMap();
  }
  diffs=new DifferenceEngine(text1,text2).generate();
  if (diffs == null) {
    diffs=new ArrayList();
    diffs.add(new Difference(EditType.DELETE,text1));
    diffs.add(new Difference(EditType.INSERT,text2));
  }
  if (checkLines && lineMap != null) {
    lineMap.restore(diffs);
    DiffCleanup.cleanupSemantic(diffs);
    diffs.add(new Difference(EditType.EQUAL,"String_Node_Str"));
    int countDeletes=0;
    int countInserts=0;
    String textDelete="String_Node_Str";
    String textInsert="String_Node_Str";
    ListIterator pointer=diffs.listIterator();
    Difference curDiff=(Difference)pointer.next();
    while (curDiff != null) {
      EditType editType=curDiff.getEditType();
      if (EditType.INSERT.equals(editType)) {
        countInserts++;
        textInsert+=curDiff.getText();
      }
 else       if (EditType.DELETE.equals(editType)) {
        countDeletes++;
        textDelete+=curDiff.getText();
      }
 else {
        if (countDeletes >= 1 && countInserts >= 1) {
          pointer.previous();
          for (int j=0; j < countDeletes + countInserts; j++) {
            pointer.previous();
            pointer.remove();
          }
          Diff newDiff=new Diff(textDelete,textInsert,false);
          Iterator iter=newDiff.compare().iterator();
          while (iter.hasNext()) {
            pointer.add(iter.next());
          }
        }
        countInserts=0;
        countDeletes=0;
        textDelete="String_Node_Str";
        textInsert="String_Node_Str";
      }
      curDiff=pointer.hasNext() ? (Difference)pointer.next() : null;
    }
    diffs.remove(diffs.size() - 1);
  }
  return diffs;
}