Program: 24840
Project: 24840
Buggy source:
/** 
 * Process the list of files queued for indexing or reindexing. <br><br> This method iterates through the list of queued source text files, calling the   {@link XMLTextProcessor#processText(XMLTextProcessor.SrcTextInfo,int) processText()}method to (re)index the file as needed. <br><br>
 * @throws IOException   Any I/O exceptions encountered when reading the sourcetext file or writing to the Lucene index. <br><br>
 * @.notes Originally, the <code>XMLTextProcessor</code> opened the Lucene  database, (re)indexed the source file, and then closed the database  for each XML file encountered in the source tree. Unfortunately,  opening and closing the Lucene database is a fairly time consuming operation, and doing so for each file made the time to index an entire  source tree much higher than it had to be. So to minimize the open/close overhead, the <code>XMLTextProcessor</code> was changed to traverse the source tree first and collect all the XML filenames it found into a  processing queue. Once the files were queued, the Lucene database could  be opened, all the files in the queue could be (re)indexed, and the  database could be closed. Doing so significantly reduced the time to  index the entire source tree. <br><br> It should be noted that each file in the queue is identified by a  "relocatable" path to the source tree directory where it was found, and that this relocatable path is stored in the Lucene database when the file is indexed. This relocatable path consists of the index name  followed by the source tree sub-path at which the file is located. Storing this relocatable file path in the index allows the indexer  and the search engine to correctly locate the source text, even if  the source tree base directory has been renamed or moved. Correctly locating the original source text for chunks in an index is necessary when displaying search results, or to determine if source text needs  to be reindexed due to changes, or removed from an index because it no longer exists. Ultimately, both the indexer and the query  engine use the  {@linkplain XMLConfigParser index configuration file} tomap the index name back into an absolute path when a source text needs to be accessed. <br><br>
 */
public void processQueuedTexts() throws IOException {
}

Fixed version (ground truth):
/** 
 * Process the list of files queued for indexing or reindexing. <br><br> This method iterates through the list of queued source text files, calling the   {@link XMLTextProcessor#processText(XMLTextProcessor.SrcTextInfo,int) processText()}method to (re)index the file as needed. <br><br>
 * @throws IOException   Any I/O exceptions encountered when reading the sourcetext file or writing to the Lucene index. <br><br>
 * @.notes Originally, the <code>XMLTextProcessor</code> opened the Lucene  database, (re)indexed the source file, and then closed the database  for each XML file encountered in the source tree. Unfortunately,  opening and closing the Lucene database is a fairly time consuming operation, and doing so for each file made the time to index an entire  source tree much higher than it had to be. So to minimize the open/close overhead, the <code>XMLTextProcessor</code> was changed to traverse the source tree first and collect all the XML filenames it found into a  processing queue. Once the files were queued, the Lucene database could  be opened, all the files in the queue could be (re)indexed, and the  database could be closed. Doing so significantly reduced the time to  index the entire source tree. <br><br> It should be noted that each file in the queue is identified by a  "relocatable" path to the source tree directory where it was found, and that this relocatable path is stored in the Lucene database when the file is indexed. This relocatable path consists of the index name  followed by the source tree sub-path at which the file is located. Storing this relocatable file path in the index allows the indexer  and the search engine to correctly locate the source text, even if  the source tree base directory has been renamed or moved. Correctly locating the original source text for chunks in an index is necessary when displaying search results, or to determine if source text needs  to be reindexed due to changes, or removed from an index because it no longer exists. Ultimately, both the indexer and the query  engine use the  {@linkplain XMLConfigParser index configuration file} tomap the index name back into an absolute path when a source text needs to be accessed. <br><br>
 */
public void processQueuedTexts() throws IOException {
  blurbedText=new StringBuffer(bufStartSize);
  accumText=new StringBuffer(bufStartSize);
  compactedAccumText=new StringBuffer(bufStartSize);
  try {
    openIdxForWriting();
    int nFiles=fileQueue.size();
    int fileNum=0;
    while (!fileQueue.isEmpty()) {
      SrcTextInfo idxFile=(SrcTextInfo)fileQueue.removeFirst();
      int percent=(nFiles <= 1) ? -1 : ((fileNum + 1) * 100 / nFiles);
      processText(idxFile,percent);
      fileNum++;
    }
  }
 catch (  IOException e) {
    Trace.tab();
    Trace.error("String_Node_Str" + e);
    Trace.untab();
  }
}