Program: 162229
Project: 162229
Buggy source:
private void startPhase(int i){
  SuffixNode lastCreatedInternalNode=null;
  end.end++;
  remainingSuffixCount++;
  while (remainingSuffixCount > 0) {
    if (active.activeLength == 0) {
      if (selectNode(i) != null) {
        active.activeEdge=selectNode(i).start;
        active.activeLength++;
        break;
      }
 else {
        root.child[input[i]]=SuffixNode.createNode(i,end);
        remainingSuffixCount--;
      }
    }
 else {
      try {
        char ch=nextChar(i);
        if (ch == input[i]) {
          if (lastCreatedInternalNode != null) {
            lastCreatedInternalNode.suffixLink=selectNode();
          }
          walkDown(i);
          break;
        }
 else {
          SuffixNode node=selectNode();
          int oldStart=node.start;
          node.start=node.start + active.activeLength;
          SuffixNode newInternalNode=SuffixNode.createNode(oldStart,new End(oldStart + active.activeLength - 1));
          SuffixNode newLeafNode=SuffixNode.createNode(i,this.end);
          newInternalNode.child[input[newInternalNode.start + active.activeLength]]=node;
          newInternalNode.child[input[i]]=newLeafNode;
          newInternalNode.index=-1;
          active.activeNode.child[input[newInternalNode.start]]=newInternalNode;
          if (lastCreatedInternalNode != null) {
            lastCreatedInternalNode.suffixLink=newInternalNode;
          }
          lastCreatedInternalNode=newInternalNode;
          newInternalNode.suffixLink=root;
          if (active.activeNode != root) {
            active.activeNode=active.activeNode.suffixLink;
          }
 else {
            active.activeEdge=active.activeEdge + 1;
            active.activeLength--;
          }
          remainingSuffixCount--;
        }
      }
 catch (      EndOfPathException e) {
        SuffixNode node=selectNode();
        node.child[input[i]]=SuffixNode.createNode(i,end);
        if (active.activeNode != root) {
          active.activeNode=active.activeNode.suffixLink;
        }
 else {
          active.activeEdge=active.activeEdge + 1;
          active.activeLength--;
        }
        remainingSuffixCount--;
      }
    }
  }
}

Fixed version (ground truth):
private void startPhase(int i){
  SuffixNode lastCreatedInternalNode=null;
  end.end++;
  remainingSuffixCount++;
  while (remainingSuffixCount > 0) {
    if (active.activeLength == 0) {
      if (selectNode(i) != null) {
        active.activeEdge=selectNode(i).start;
        active.activeLength++;
        break;
      }
 else {
        root.child[input[i]]=SuffixNode.createNode(i,end);
        remainingSuffixCount--;
      }
    }
 else {
      try {
        char ch=nextChar(i);
        if (ch == input[i]) {
          if (lastCreatedInternalNode != null) {
            lastCreatedInternalNode.suffixLink=selectNode();
          }
          walkDown(i);
          break;
        }
 else {
          SuffixNode node=selectNode();
          int oldStart=node.start;
          node.start=node.start + active.activeLength;
          SuffixNode newInternalNode=SuffixNode.createNode(oldStart,new End(oldStart + active.activeLength - 1));
          SuffixNode newLeafNode=SuffixNode.createNode(i,this.end);
          newInternalNode.child[input[newInternalNode.start + active.activeLength]]=node;
          newInternalNode.child[input[i]]=newLeafNode;
          newInternalNode.index=-1;
          active.activeNode.child[input[newInternalNode.start]]=newInternalNode;
          if (lastCreatedInternalNode != null) {
            lastCreatedInternalNode.suffixLink=newInternalNode;
          }
          lastCreatedInternalNode=newInternalNode;
          newInternalNode.suffixLink=root;
          if (active.activeNode != root) {
            active.activeNode=active.activeNode.suffixLink;
          }
 else {
            active.activeEdge=active.activeEdge + 1;
            active.activeLength--;
          }
          remainingSuffixCount--;
        }
      }
 catch (      EndOfPathException e) {
        SuffixNode node=selectNode();
        node.child[input[i]]=SuffixNode.createNode(i,end);
        if (lastCreatedInternalNode != null) {
          lastCreatedInternalNode.suffixLink=node;
        }
        lastCreatedInternalNode=node;
        if (active.activeNode != root) {
          active.activeNode=active.activeNode.suffixLink;
        }
 else {
          active.activeEdge=active.activeEdge + 1;
          active.activeLength--;
        }
        remainingSuffixCount--;
      }
    }
  }
}