Program: 24666
Project: 24666
Buggy source:
/** 
 * Parse the XML source text file specified. <br><br> This method instantiates a SAX XML file parser and passes this class as the token handler. Doing so causes the  {@link XMLTextProcessor#startDocument() startDocument()},  {@link XMLTextProcessor#startElement(String,String,String,Attributes) startElement()},  {@link XMLTextProcessor#endElement(String,String,String) endElement()},  {@link XMLTextProcessor#endDocument() endDocument()}, and  {@link XMLTextProcessor#characters(char[],int,int) characters()}methods in this class to be called. These methods in turn process the actual text in the XML source document, "blurbifying" the text, breaking it up into overlapping chunks, and adding it to the Lucene index. <br><br>
 * @return  <code>0</code> - XML source file successfully parsed and indexed.<br> <code>-1</code> - One or more errors encountered processing XML source file.
 * @.notes For more about "blurbifying" text, see the  {@link XMLTextProcessor#blurbify(StringBuffer,boolean) blurbify()}method. <br><br> This function enables namespaces for XML tag attributes. Consquently, attributes such as <code>sectiontype</code> and <code>proximitybreak</code> are assumed to be prefixed by the namespace <code>xtf</code>. <br><br> If present in the   {@link XMLTextProcessor#indexInfo indexInfo} member,the XML file will be prefiltered with the specified XSL filter before XML parsing begins. This allows node attributes to be inserted that modify the proximity of various text sections as well as boost or deemphasize the relevance sections of text. For a description of attributes handled by this XML parser, see the  {@link XMLTextProcessor}class description. <br><br>
 */
private int parseText(){
  try {
    SAXParser xmlParser=IndexUtil.createSAXParser();
    InputSource xmlSource=curIdxRecord.xmlSource();
    Templates[] prefilters=curIdxSrc.preFilters();
    if (prefilters == null || prefilters.length == 0) {
      xmlParser.parse(xmlSource,this);
      return 0;
    }
    IndexUtil.applyPreFilters(prefilters,xmlParser.getXMLReader(),xmlSource,new SAXResult(this));
  }
 catch (  Throwable t) {
    if (lazyReceiver != null) {
      lazyBuilder.abort(lazyReceiver);
      lazyBuilder=null;
      lazyReceiver=null;
      lazyHandler=null;
    }
    Trace.more(Trace.info,"String_Node_Str");
    String message="String_Node_Str" + t.getClass() + "String_Node_Str"+ "String_Node_Str"+ t.getMessage()+ "String_Node_Str"+ "String_Node_Str"+ curPrettyKey;
    if (curIdxRecord.recordNum() > 0)     message+=("String_Node_Str" + curIdxRecord.recordNum());
    Trace.info(message);
    return -1;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Parse the XML source text file specified. <br><br> This method instantiates a SAX XML file parser and passes this class as the token handler. Doing so causes the  {@link XMLTextProcessor#startDocument() startDocument()},  {@link XMLTextProcessor#startElement(String,String,String,Attributes) startElement()},  {@link XMLTextProcessor#endElement(String,String,String) endElement()},  {@link XMLTextProcessor#endDocument() endDocument()}, and  {@link XMLTextProcessor#characters(char[],int,int) characters()}methods in this class to be called. These methods in turn process the actual text in the XML source document, "blurbifying" the text, breaking it up into overlapping chunks, and adding it to the Lucene index. <br><br>
 * @return  <code>0</code> - XML source file successfully parsed and indexed.<br> <code>-1</code> - One or more errors encountered processing XML source file.
 * @.notes For more about "blurbifying" text, see the  {@link XMLTextProcessor#blurbify(StringBuffer,boolean) blurbify()}method. <br><br> This function enables namespaces for XML tag attributes. Consquently, attributes such as <code>sectiontype</code> and <code>proximitybreak</code> are assumed to be prefixed by the namespace <code>xtf</code>. <br><br> If present in the   {@link XMLTextProcessor#indexInfo indexInfo} member,the XML file will be prefiltered with the specified XSL filter before XML parsing begins. This allows node attributes to be inserted that modify the proximity of various text sections as well as boost or deemphasize the relevance sections of text. For a description of attributes handled by this XML parser, see the  {@link XMLTextProcessor}class description. <br><br>
 */
private int parseText(){
  try {
    SAXParser xmlParser=IndexUtil.createSAXParser();
    InputSource xmlSource=curIdxRecord.xmlSource();
    Templates[] prefilters=curIdxSrc.preFilters();
    if (prefilters == null || prefilters.length == 0) {
      xmlParser.parse(xmlSource,this);
      return 0;
    }
    IndexUtil.applyPreFilters(prefilters,xmlParser.getXMLReader(),xmlSource,new SAXResult(this));
  }
 catch (  Throwable t) {
    if (lazyReceiver != null) {
      lazyBuilder.abort(lazyReceiver);
      lazyBuilder=null;
      lazyReceiver=null;
      lazyHandler=null;
    }
    Trace.more(Trace.info,"String_Node_Str");
    String message="String_Node_Str" + t.getClass() + "String_Node_Str"+ "String_Node_Str"+ t.getMessage()+ "String_Node_Str"+ "String_Node_Str"+ curPrettyKey;
    if (curIdxRecord.recordNum() > 0)     message+=("String_Node_Str" + curIdxRecord.recordNum());
    Trace.info(message);
    if (docWordCount > 0 || subDocumentCount > 0) {
      try {
        openIdxForReading();
        indexReader.deleteDocuments(new Term("String_Node_Str",curIdxSrc.key()));
      }
 catch (      Throwable t2) {
        Trace.warning("String_Node_Str" + t2.getClass() + "String_Node_Str"+ t2.getMessage());
      }
    }
    return -1;
  }
  return 0;
}