Program: 24675
Project: 24675
Buggy source:
/** 
 * Add the specified XML source record to the active Lucene index. This method indexes the specified XML source text file, adding it to the Lucene database currently specified by the   {@link #indexPath} member.
 * @param file      The XML source text file to process.
 * @param record    Record within the XML file to process.
 * @param recordNum Zero-based index of this record in the XML file.
 * @throws IOException  Any I/O errors encountered opening or reading the XML sourcetext file or the Lucene database. <br><br>
 * @.notes To learn more about the actual mechanincs of how XML source files are indexed, see the  {@link XMLTextProcessor} class description.
 */
private int processText(IndexSource file,IndexRecord record,int recordNum) throws IOException {
  accumText.setLength(0);
  compactedAccumText.setLength(0);
  curIdxSrc=file;
  curIdxRecord=record;
  lazyStore=record.lazyStore();
  if (lazyStore != null) {
    Configuration config=new Configuration();
    config.setNamePool(NamePool.getDefaultNamePool());
    lazyBuilder=new LazyTreeBuilder(config);
    lazyReceiver=lazyBuilder.begin(lazyStore);
    lazyBuilder.setNamePool(config.getNamePool());
    lazyHandler=new ReceivingContentHandler();
    lazyHandler.setReceiver(lazyReceiver);
    lazyHandler.setPipelineConfiguration(lazyReceiver.getPipelineConfiguration());
  }
 else {
    lazyBuilder=null;
    lazyReceiver=null;
    lazyHandler=null;
  }
  chunkWordSize=indexInfo.getChunkSize();
  chunkWordOvlp=indexInfo.getChunkOvlp();
  chunkWordOvlpStart=chunkWordSize - chunkWordOvlp;
  curNode=0;
  chunkStartNode=-1;
  nextChunkStartNode=-1;
  nodeWordCount=0;
  chunkWordCount=0;
  chunkWordOffset=0;
  nextChunkStartIdx=0;
  nextChunkWordCount=0;
  nextChunkWordOffset=0;
  forcedChunk=false;
  inMeta=0;
  metaBuf.setLength(0);
  chunkCount=0;
  section=new SectionInfoStack();
  section.push();
  int result=parseText();
  if (lazyBuilder != null) {
    lazyBuilder.finish(lazyReceiver,false);
    if (result == 0) {
      Templates displayStyle=file.displayStyle();
      if (displayStyle != null) {
        try {
          precacheXSLKeys();
        }
 catch (        IOException e) {
          Trace.tab();
          Trace.error("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ e);
          Trace.untab();
          throw e;
        }
catch (        Throwable t) {
          Trace.tab();
          Trace.error("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ t);
          Trace.untab();
          if (t instanceof RuntimeException)           throw (RuntimeException)t;
 else           throw new IOException("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ t);
        }
      }
    }
    lazyStore.close();
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Add the specified XML source record to the active Lucene index. This method indexes the specified XML source text file, adding it to the Lucene database currently specified by the   {@link #indexPath} member.
 * @param file      The XML source text file to process.
 * @param record    Record within the XML file to process.
 * @param recordNum Zero-based index of this record in the XML file.
 * @throws IOException  Any I/O errors encountered opening or reading the XML sourcetext file or the Lucene database. <br><br>
 * @.notes To learn more about the actual mechanincs of how XML source files are indexed, see the  {@link XMLTextProcessor} class description.
 */
private int processText(IndexSource file,IndexRecord record,int recordNum) throws IOException {
  accumText.setLength(0);
  compactedAccumText.setLength(0);
  curIdxSrc=file;
  curIdxRecord=record;
  lazyStore=record.lazyStore();
  if (lazyStore != null) {
    Configuration config=new Configuration();
    config.setNamePool(NamePool.getDefaultNamePool());
    lazyBuilder=new LazyTreeBuilder(config);
    lazyReceiver=lazyBuilder.begin(lazyStore);
    lazyBuilder.setNamePool(config.getNamePool());
    lazyHandler=new ReceivingContentHandler();
    lazyHandler.setReceiver(lazyReceiver);
    lazyHandler.setPipelineConfiguration(lazyReceiver.getPipelineConfiguration());
  }
 else {
    lazyBuilder=null;
    lazyReceiver=null;
    lazyHandler=null;
  }
  chunkWordSize=indexInfo.getChunkSize();
  chunkWordOvlp=indexInfo.getChunkOvlp();
  chunkWordOvlpStart=chunkWordSize - chunkWordOvlp;
  curNode=0;
  chunkStartNode=-1;
  nextChunkStartNode=-1;
  nodeWordCount=0;
  chunkWordCount=0;
  chunkWordOffset=0;
  nextChunkStartIdx=0;
  nextChunkWordCount=0;
  nextChunkWordOffset=0;
  forcedChunk=false;
  inMeta=0;
  metaBuf.setLength(0);
  chunkCount=0;
  docWordCount=0;
  section=new SectionInfoStack();
  section.push();
  int result=parseText();
  if (lazyBuilder != null) {
    lazyBuilder.finish(lazyReceiver,false);
    if (result == 0) {
      Templates displayStyle=file.displayStyle();
      if (displayStyle != null) {
        try {
          precacheXSLKeys();
        }
 catch (        IOException e) {
          Trace.tab();
          Trace.error("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ e);
          Trace.untab();
          throw e;
        }
catch (        Throwable t) {
          Trace.tab();
          Trace.error("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ t);
          Trace.untab();
          if (t instanceof RuntimeException)           throw (RuntimeException)t;
 else           throw new IOException("String_Node_Str" + "String_Node_Str" + displayStyle + "String_Node_Str"+ t);
        }
      }
    }
    lazyStore.close();
  }
  return result;
}