Program: 2111
Project: 2111
Buggy source:
public void rebuildIndex(ProgressHandle ph){
  LOG.info("String_Node_Str");
  long start=System.currentTimeMillis();
  long start2=start;
  IndexWriter writer=null;
  try {
    writer=getIndexWriter();
    writer.deleteAll();
    writer.commit();
    Collection<Note> notes=getAllNotes();
    LOG.info("String_Node_Str" + notes.size());
    ph.switchToDeterminate(notes.size());
    int i=0;
    for (    Note noteWithoutContents : notes) {
      if (Thread.interrupted()) {
        writer.close();
        LOG.warning("String_Node_Str");
        return;
      }
      Note note=getProperNote(noteWithoutContents);
      if (null != note) {
        Document document=getLuceneDocument(note);
        writer.addDocument(document);
        ++i;
        if ((i % REPORTEVERY) == 0) {
          ph.progress("String_Node_Str" + note.getTitle(),i);
          writer.commit();
          long delta=System.currentTimeMillis() - start2;
          start2=System.currentTimeMillis();
          LOG.info(i + "String_Node_Str" + (delta / 1000.0)+ "String_Node_Str");
        }
      }
 else {
        break;
      }
    }
    writer.commit();
    LOG.info(i + "String_Node_Str");
    LOG.info("String_Node_Str");
    writer.optimize();
    writer.close();
  }
 catch (  Exception ex) {
    LOG.log(Level.WARNING,"String_Node_Str",ex);
    Exceptions.printStackTrace(ex);
  }
 finally {
    try {
      if (writer != null) {
        writer.close();
      }
    }
 catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
  long delta=System.currentTimeMillis() - start;
  LOG.info("String_Node_Str" + delta / 1000L + "String_Node_Str");
}

Fixed version (ground truth):
public void rebuildIndex(ProgressHandle ph){
  LOG.info("String_Node_Str");
  long start=System.currentTimeMillis();
  long start2=start;
  IndexWriter writer=null;
  try {
    writer=getIndexWriter();
    writer.deleteAll();
    writer.commit();
    Collection<Note> notes=getAllNotes();
    LOG.info("String_Node_Str" + notes.size());
    ph.switchToDeterminate(notes.size());
    int i=0;
    for (    Note noteWithoutContents : notes) {
      if (Thread.interrupted()) {
        writer.close();
        LOG.warning("String_Node_Str");
        return;
      }
      Note note=getProperNote(noteWithoutContents);
      if (null != note) {
        Document document=getLuceneDocument(note);
        writer.addDocument(document);
        ++i;
        if ((i % REPORTEVERY) == 0) {
          ph.progress("String_Node_Str" + note.getTitle(),i);
          writer.commit();
          long delta=System.currentTimeMillis() - start2;
          start2=System.currentTimeMillis();
          LOG.fine(i + "String_Node_Str" + (delta / 1000.0)+ "String_Node_Str");
        }
      }
 else {
        break;
      }
    }
    writer.commit();
    LOG.info(i + "String_Node_Str");
    LOG.info("String_Node_Str");
    start2=System.currentTimeMillis();
    writer.optimize();
    writer.close();
    long delta=System.currentTimeMillis() - start2;
    LOG.info("String_Node_Str" + delta / 1000.0 + "String_Node_Str");
  }
 catch (  Exception ex) {
    LOG.log(Level.WARNING,"String_Node_Str",ex);
    Exceptions.printStackTrace(ex);
  }
 finally {
    try {
      if (writer != null) {
        writer.close();
      }
    }
 catch (    Exception ex) {
      Exceptions.printStackTrace(ex);
    }
  }
  long delta=System.currentTimeMillis() - start;
  LOG.info("String_Node_Str" + delta / 1000L + "String_Node_Str");
}