Program: 66518
Project: 66518
Buggy source:
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;
}
}
}

Fixed version (ground truth):
private void parseEvent(XMLStreamReader xmlStreamReader) throws SAXException {
switch (xmlStreamReader.getEventType()) {
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:
{
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;
}
}
}