Program: 132304
Project: 132304
Buggy source:
/** 
 * @param logFiles
 * @param from - inclusive, if everything went fine, next() will return the log entry identified by LSN <code>from</code>.
 * @throws LogEntryException
 * @throws IOException
 */
public DiskLogIterator(File[] logFiles,LSN from) throws LogEntryException, IOException {
  this.from=from;
  if (logFiles != null && logFiles.length > 0) {
    dbLogDir=logFiles[0].getParent() + "String_Node_Str";
    int count=-1;
    SortedSet<LSN> orderedLogList=new TreeSet<LSN>();
    Pattern p=Pattern.compile("String_Node_Str");
    for (    File logFile : logFiles) {
      Matcher m=p.matcher(logFile.getName());
      m.matches();
      String tmp=m.group(1);
      int viewId=Integer.valueOf(tmp);
      tmp=m.group(2);
      int seqNo=Integer.valueOf(tmp);
      orderedLogList.add(new LSN(viewId,seqNo));
      count++;
    }
    LSN[] copy=orderedLogList.toArray(new LSN[orderedLogList.size()]);
    LSN last=null;
    LSN lastRemoved=null;
    for (    LSN lsn : copy) {
      if (last == null)       last=lsn;
 else {
        if (from != null && lsn.compareTo(from) < 0) {
          orderedLogList.remove(last);
          lastRemoved=last;
          last=lsn;
        }
 else         break;
      }
    }
    if (from != null && !LSMDatabase.NO_DB_LSN.equals(from) && last.compareTo(from) > 0)     throw new LogEntryException("String_Node_Str" + from.toString() + "String_Node_Str"+ last.toString());
    if (lastRemoved != null && from.compareTo(last) < 0) {
      orderedLogList.add(lastRemoved);
    }
    logList=orderedLogList.iterator();
    findFirstEntry();
  }
}

Fixed version (ground truth):
/** 
 * @param logFiles
 * @param from - inclusive, if everything went fine, next() will return the log entry identified by LSN <code>from</code>.
 * @throws LogEntryException
 * @throws IOException
 */
public DiskLogIterator(File[] logFiles,LSN from) throws LogEntryException, IOException {
  this.from=from;
  if (logFiles != null && logFiles.length > 0) {
    dbLogDir=logFiles[0].getParent() + "String_Node_Str";
    int count=-1;
    SortedSet<LSN> orderedLogList=new TreeSet<LSN>();
    Pattern p=Pattern.compile("String_Node_Str");
    for (    File logFile : logFiles) {
      Matcher m=p.matcher(logFile.getName());
      m.matches();
      String tmp=m.group(1);
      int viewId=Integer.valueOf(tmp);
      tmp=m.group(2);
      int seqNo=Integer.valueOf(tmp);
      orderedLogList.add(new LSN(viewId,seqNo));
      count++;
    }
    LSN[] copy=orderedLogList.toArray(new LSN[orderedLogList.size()]);
    LSN last=null;
    LSN lastRemoved=null;
    for (    LSN lsn : copy) {
      if (last == null)       last=lsn;
 else {
        if (from != null && lsn.compareTo(from) <= 0) {
          orderedLogList.remove(last);
          lastRemoved=last;
          last=lsn;
        }
 else         break;
      }
    }
    if (from != null && !LSMDatabase.NO_DB_LSN.equals(from) && last.compareTo(from) > 0)     throw new LogEntryException("String_Node_Str" + from.toString() + "String_Node_Str"+ last.toString());
    if (lastRemoved != null && from.compareTo(last) < 0) {
      orderedLogList.add(lastRemoved);
    }
    logList=orderedLogList.iterator();
    findFirstEntry();
  }
}