Program: 11241
Project: 11241
Buggy source:
public LuceneIndexHandler(Configuration aConfiguration,AnalyzerCache aAnalyzerCache,ExecutorPool aExecutorPool) throws IOException {
  configuration=aConfiguration;
  analyzerCache=aAnalyzerCache;
  executorPool=aExecutorPool;
  contentFieldType=new FieldType();
  contentFieldType.setIndexed(true);
  contentFieldType.setStored(true);
  contentFieldType.setTokenized(true);
  contentFieldType.setStoreTermVectorOffsets(true);
  contentFieldType.setStoreTermVectorPayloads(true);
  contentFieldType.setStoreTermVectorPositions(true);
  contentFieldType.setStoreTermVectors(true);
  contentFieldType.setIndexOptions(FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
  analyzer=analyzerCache.getAnalyzer();
  File theIndexDirectory=new File(aConfiguration.getConfigDirectory(),"String_Node_Str");
  theIndexDirectory.mkdirs();
  Directory theIndexFSDirectory=new NRTCachingDirectory(FSDirectory.open(theIndexDirectory),100,100);
  try {
    theIndexFSDirectory.clearLock(IndexWriter.WRITE_LOCK_NAME);
  }
 catch (  IOException e) {
  }
  File theSuggestDirectory=new File(aConfiguration.getConfigDirectory(),"String_Node_Str");
  theSuggestDirectory.mkdirs();
  Directory theSuggestFSDirectory=FSDirectory.open(theSuggestDirectory);
  try {
    theSuggestFSDirectory.clearLock(IndexWriter.WRITE_LOCK_NAME);
  }
 catch (  IOException e) {
  }
  IndexWriterConfig theConfig=new IndexWriterConfig(IndexFields.LUCENE_VERSION,analyzer);
  theConfig.setSimilarity(new CustomSimilarity());
  indexWriter=new IndexWriter(theIndexFSDirectory,theConfig);
  searcherManager=new SearcherManager(indexWriter,true,new SearcherFactory());
  commitThread=new Thread("String_Node_Str"){
    @Override public void run(){
      while (!isInterrupted()) {
        if (indexWriter.hasUncommittedChanges()) {
          try {
            indexWriter.commit();
          }
 catch (          IOException e) {
            throw new RuntimeException(e);
          }
        }
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
;
  commitThread.start();
  facetsConfig=new FacetsConfig();
}

Fixed version (ground truth):
public LuceneIndexHandler(Configuration aConfiguration,AnalyzerCache aAnalyzerCache,ExecutorPool aExecutorPool) throws IOException {
  configuration=aConfiguration;
  analyzerCache=aAnalyzerCache;
  executorPool=aExecutorPool;
  contentFieldType=new FieldType();
  contentFieldType.setIndexed(true);
  contentFieldType.setStored(true);
  contentFieldType.setTokenized(true);
  contentFieldType.setStoreTermVectorOffsets(true);
  contentFieldType.setStoreTermVectorPayloads(true);
  contentFieldType.setStoreTermVectorPositions(true);
  contentFieldType.setStoreTermVectors(true);
  contentFieldType.setIndexOptions(FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS);
  analyzer=analyzerCache.getAnalyzer();
  File theIndexDirectory=new File(aConfiguration.getConfigDirectory(),"String_Node_Str");
  theIndexDirectory.mkdirs();
  Directory theIndexFSDirectory=new NRTCachingDirectory(FSDirectory.open(theIndexDirectory),100,100);
  try {
    theIndexFSDirectory.clearLock(IndexWriter.WRITE_LOCK_NAME);
  }
 catch (  IOException e) {
  }
  IndexWriterConfig theConfig=new IndexWriterConfig(IndexFields.LUCENE_VERSION,analyzer);
  theConfig.setSimilarity(new CustomSimilarity());
  indexWriter=new IndexWriter(theIndexFSDirectory,theConfig);
  searcherManager=new SearcherManager(indexWriter,true,new SearcherFactory());
  commitThread=new Thread("String_Node_Str"){
    @Override public void run(){
      while (!isInterrupted()) {
        if (indexWriter.hasUncommittedChanges()) {
          try {
            indexWriter.commit();
          }
 catch (          IOException e) {
            throw new RuntimeException(e);
          }
        }
        try {
          Thread.sleep(2000);
        }
 catch (        InterruptedException e) {
        }
      }
    }
  }
;
  commitThread.start();
  facetsConfig=new FacetsConfig();
}