Program: 66635
Project: 66635
Buggy source:
private void parseEvent(XMLStreamReader xmlStreamReader) throws SAXException {
switch (xmlStreamReader.getEventType()) {
case XMLStreamReader.START_ELEMENT:
{
      depth++;
      String prefix=xmlStreamReader.getPrefix();
      String localName=xmlStreamReader.getLocalName();
      if (null == prefix || prefix.length() == 0) {
        contentHandler.startElement(xmlStreamReader.getNamespaceURI(),localName,localName,new IndexedAttributeList(xmlStreamReader));
      }
 else {
        contentHandler.startElement(xmlStreamReader.getNamespaceURI(),localName,prefix + XMLConstants.COLON + localName,new IndexedAttributeList(xmlStreamReader));
      }
      break;
    }
case XMLStreamReader.END_ELEMENT:
{
    depth--;
    String prefix=xmlStreamReader.getPrefix();
    String localName=xmlStreamReader.getLocalName();
    if (null == prefix || prefix.length() == 0) {
      contentHandler.endElement(xmlStreamReader.getNamespaceURI(),localName,localName);
    }
 else {
      contentHandler.endElement(xmlStreamReader.getNamespaceURI(),localName,prefix + XMLConstants.COLON + localName);
    }
    break;
  }
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
  contentHandler.processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
  break;
}
case XMLStreamReader.CHARACTERS:
{
contentHandler.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.SPACE:
{
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
break;
}
case XMLStreamReader.START_DOCUMENT:
{
depth++;
break;
}
case XMLStreamReader.END_DOCUMENT:
{
depth--;
return;
}
case XMLStreamReader.ENTITY_REFERENCE:
{
break;
}
case XMLStreamReader.ATTRIBUTE:
{
break;
}
case XMLStreamReader.DTD:
{
break;
}
case XMLStreamReader.CDATA:
{
char[] characters=xmlStreamReader.getText().toCharArray();
if (null == lexicalHandler) {
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
}
 else {
lexicalHandler.startCDATA();
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
lexicalHandler.endCDATA();
}
break;
}
}
}

Fixed version (ground truth):
private void parseEvent(XMLStreamReader xmlStreamReader) throws SAXException {
switch (xmlStreamReader.getEventType()) {
case XMLStreamReader.START_ELEMENT:
{
      depth++;
      String localName=xmlStreamReader.getLocalName();
      if (qNameAware) {
        String prefix=xmlStreamReader.getPrefix();
        if (null == prefix || prefix.length() == 0) {
          contentHandler.startElement(xmlStreamReader.getNamespaceURI(),localName,localName,indexedAttributeList.reset());
        }
 else {
          contentHandler.startElement(xmlStreamReader.getNamespaceURI(),localName,prefix + XMLConstants.COLON + localName,indexedAttributeList.reset());
        }
      }
 else {
        contentHandler.startElement(xmlStreamReader.getNamespaceURI(),localName,null,indexedAttributeList.reset());
      }
      break;
    }
case XMLStreamReader.END_ELEMENT:
{
    depth--;
    String localName=xmlStreamReader.getLocalName();
    if (qNameAware) {
      String prefix=xmlStreamReader.getPrefix();
      if (null == prefix || prefix.length() == 0) {
        contentHandler.endElement(xmlStreamReader.getNamespaceURI(),localName,localName);
      }
 else {
        contentHandler.endElement(xmlStreamReader.getNamespaceURI(),localName,prefix + XMLConstants.COLON + localName);
      }
    }
 else {
      contentHandler.endElement(xmlStreamReader.getNamespaceURI(),localName,null);
    }
    break;
  }
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
  contentHandler.processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
  break;
}
case XMLStreamReader.CHARACTERS:
{
contentHandler.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.SPACE:
{
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
break;
}
case XMLStreamReader.START_DOCUMENT:
{
depth++;
break;
}
case XMLStreamReader.END_DOCUMENT:
{
depth--;
return;
}
case XMLStreamReader.ENTITY_REFERENCE:
{
break;
}
case XMLStreamReader.ATTRIBUTE:
{
break;
}
case XMLStreamReader.DTD:
{
break;
}
case XMLStreamReader.CDATA:
{
char[] characters=xmlStreamReader.getText().toCharArray();
if (null == lexicalHandler) {
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
}
 else {
lexicalHandler.startCDATA();
contentHandler.characters(xmlStreamReader.getTextCharacters(),xmlStreamReader.getTextStart(),xmlStreamReader.getTextLength());
lexicalHandler.endCDATA();
}
break;
}
}
}