Program: 67036
Project: 67036
Buggy source:
private void parseEvent(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 || prefix.length() == 0) {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName());
}
 else {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + XMLConstants.COLON + 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 || prefix.length() == 0) {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
 else {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + XMLConstants.COLON + xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
break;
}
}
}

Fixed version (ground truth):
private void parseEvent(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--;
return;
}
case XMLStreamReader.END_ELEMENT:
{
depth--;
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || prefix.length() == 0) {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName());
}
 else {
getContentHandler().endElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + XMLConstants.COLON + 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++;
break;
}
case XMLStreamReader.START_ELEMENT:
{
depth++;
String prefix=xmlStreamReader.getPrefix();
if (null == prefix || prefix.length() == 0) {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
 else {
getContentHandler().startElement(xmlStreamReader.getNamespaceURI(),xmlStreamReader.getLocalName(),prefix + XMLConstants.COLON + xmlStreamReader.getLocalName(),new IndexedAttributeList(xmlStreamReader));
}
break;
}
}
}