Program: 67150
Project: 67150
Buggy source:
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  if (null == getContentHandler()) {
    return;
  }
switch (xmlStreamReader.getEventType()) {
case XMLStreamReader.ATTRIBUTE:
{
      break;
    }
case XMLStreamReader.CDATA:
{
    if (null == lexicalHandler) {
      getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
    }
 else {
      lexicalHandler.startCDATA();
      getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
      lexicalHandler.endCDATA();
    }
    break;
  }
case XMLStreamReader.CHARACTERS:
{
  getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
  break;
}
case XMLStreamReader.COMMENT:
{
if (null != lexicalHandler) {
  lexicalHandler.comment(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
}
break;
}
case XMLStreamReader.DTD:
{
break;
}
case XMLStreamReader.END_DOCUMENT:
{
getContentHandler().endDocument();
return;
}
case XMLStreamReader.END_ELEMENT:
{
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || EMPTY_STRING.equals(prefix)) {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName());
}
 else {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + ':' + xmlStreamReader.getLocalName());
}
break;
}
case XMLStreamReader.ENTITY_DECLARATION:
{
break;
}
case XMLStreamReader.ENTITY_REFERENCE:
{
break;
}
case XMLStreamReader.NAMESPACE:
{
break;
}
case XMLStreamReader.NOTATION_DECLARATION:
{
break;
}
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
getContentHandler().processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
break;
}
case XMLStreamReader.SPACE:
{
char[] characters=xmlStreamReader.getTextCharacters();
getContentHandler().characters(characters,0,characters.length);
break;
}
case XMLStreamReader.START_DOCUMENT:
{
getContentHandler().startDocument();
break;
}
case XMLStreamReader.START_ELEMENT:
{
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || EMPTY_STRING.equals(prefix)) {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
 else {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + ':' + xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
break;
}
}
try {
if (xmlStreamReader.hasNext()) {
xmlStreamReader.next();
parse(xmlStreamReader);
}
}
 catch (XMLStreamException e) {
throw new RuntimeException(e);
}
}

Fixed version (ground truth):
private void parse(XMLStreamReader xmlStreamReader) throws SAXException {
  if (null == getContentHandler()) {
    return;
  }
switch (xmlStreamReader.getEventType()) {
case XMLStreamReader.ATTRIBUTE:
{
      break;
    }
case XMLStreamReader.CDATA:
{
    if (null == lexicalHandler) {
      getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
    }
 else {
      lexicalHandler.startCDATA();
      getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
      lexicalHandler.endCDATA();
    }
    break;
  }
case XMLStreamReader.CHARACTERS:
{
  getContentHandler().characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
  break;
}
case XMLStreamReader.COMMENT:
{
if (null != lexicalHandler) {
  lexicalHandler.comment(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
}
break;
}
case XMLStreamReader.DTD:
{
break;
}
case XMLStreamReader.END_DOCUMENT:
{
depth--;
getContentHandler().endDocument();
return;
}
case XMLStreamReader.END_ELEMENT:
{
depth--;
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || EMPTY_STRING.equals(prefix)) {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName());
}
 else {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + ':' + xmlStreamReader.getLocalName());
}
break;
}
case XMLStreamReader.ENTITY_DECLARATION:
{
break;
}
case XMLStreamReader.ENTITY_REFERENCE:
{
break;
}
case XMLStreamReader.NAMESPACE:
{
break;
}
case XMLStreamReader.NOTATION_DECLARATION:
{
break;
}
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
getContentHandler().processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
break;
}
case XMLStreamReader.SPACE:
{
char[] characters=xmlStreamReader.getTextCharacters();
getContentHandler().characters(characters,0,characters.length);
break;
}
case XMLStreamReader.START_DOCUMENT:
{
depth++;
getContentHandler().startDocument();
break;
}
case XMLStreamReader.START_ELEMENT:
{
depth++;
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || EMPTY_STRING.equals(prefix)) {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
 else {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + ':' + xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
break;
}
}
try {
if (depth > 0 && xmlStreamReader.hasNext()) {
xmlStreamReader.next();
parse(xmlStreamReader);
}
}
 catch (XMLStreamException e) {
throw new RuntimeException(e);
}
}