Program: 64794
Project: 64794
Buggy source:
private void parseEvent(XMLStreamReader xmlStreamReader,int eventType) throws SAXException {
switch (eventType) {
case XMLStreamReader.START_ELEMENT:
{
      contentHandler.setDocumentLocator(locator);
      depth++;
      String localName=xmlStreamReader.getLocalName();
      String namespaceURI=xmlStreamReader.getNamespaceURI();
      if (XMLConstants.EMPTY_STRING.equals(namespaceURI)) {
        namespaceURI=null;
      }
      if (qNameAware) {
        String prefix=xmlStreamReader.getPrefix();
        if (null == prefix || prefix.length() == 0) {
          contentHandler.startElement(namespaceURI,localName,localName,indexedAttributeList.reset());
        }
 else {
          contentHandler.startElement(namespaceURI,localName,prefix + XMLConstants.COLON + localName,indexedAttributeList.reset());
        }
      }
 else {
        contentHandler.startElement(namespaceURI,localName,null,indexedAttributeList.reset());
      }
      break;
    }
case XMLStreamReader.END_ELEMENT:
{
    depth--;
    String localName=xmlStreamReader.getLocalName();
    String namespaceURI=xmlStreamReader.getNamespaceURI();
    if (XMLConstants.EMPTY_STRING.equals(namespaceURI)) {
      namespaceURI=null;
    }
    if (qNameAware) {
      String prefix=xmlStreamReader.getPrefix();
      if (null == prefix || prefix.length() == 0) {
        contentHandler.endElement(namespaceURI,localName,localName);
      }
 else {
        contentHandler.endElement(namespaceURI,localName,prefix + XMLConstants.COLON + localName);
      }
    }
 else {
      contentHandler.endElement(namespaceURI,localName,null);
    }
    break;
  }
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
  contentHandler.processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
  break;
}
case XMLStreamReader.CHARACTERS:
{
parseCharactersEvent(xmlStreamReader);
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) {
parseCharactersEvent(xmlStreamReader);
}
 else {
lexicalHandler.startCDATA();
parseCharactersEvent(xmlStreamReader);
lexicalHandler.endCDATA();
}
break;
}
}
}

Fixed version (ground truth):
private void parseEvent(XMLStreamReader xmlStreamReader,int eventType) throws SAXException {
switch (eventType) {
case XMLStreamReader.START_ELEMENT:
{
      depth++;
      String localName=xmlStreamReader.getLocalName();
      String namespaceURI=xmlStreamReader.getNamespaceURI();
      if (XMLConstants.EMPTY_STRING.equals(namespaceURI)) {
        namespaceURI=null;
      }
      if (qNameAware) {
        String prefix=xmlStreamReader.getPrefix();
        if (null == prefix || prefix.length() == 0) {
          contentHandler.startElement(namespaceURI,localName,localName,indexedAttributeList.reset());
        }
 else {
          contentHandler.startElement(namespaceURI,localName,prefix + XMLConstants.COLON + localName,indexedAttributeList.reset());
        }
      }
 else {
        contentHandler.startElement(namespaceURI,localName,null,indexedAttributeList.reset());
      }
      break;
    }
case XMLStreamReader.END_ELEMENT:
{
    depth--;
    String localName=xmlStreamReader.getLocalName();
    String namespaceURI=xmlStreamReader.getNamespaceURI();
    if (XMLConstants.EMPTY_STRING.equals(namespaceURI)) {
      namespaceURI=null;
    }
    if (qNameAware) {
      String prefix=xmlStreamReader.getPrefix();
      if (null == prefix || prefix.length() == 0) {
        contentHandler.endElement(namespaceURI,localName,localName);
      }
 else {
        contentHandler.endElement(namespaceURI,localName,prefix + XMLConstants.COLON + localName);
      }
    }
 else {
      contentHandler.endElement(namespaceURI,localName,null);
    }
    break;
  }
case XMLStreamReader.PROCESSING_INSTRUCTION:
{
  contentHandler.processingInstruction(xmlStreamReader.getPITarget(),xmlStreamReader.getPIData());
  break;
}
case XMLStreamReader.CHARACTERS:
{
parseCharactersEvent(xmlStreamReader);
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) {
parseCharactersEvent(xmlStreamReader);
}
 else {
lexicalHandler.startCDATA();
parseCharactersEvent(xmlStreamReader);
lexicalHandler.endCDATA();
}
break;
}
}
}