Program: 112175
Project: 112175
Buggy source:
private <T>T doXmlLoop(XMLEventReader streamReader,ParserState<T> parserState){
  ourLog.trace("String_Node_Str",parserState);
  try {
    List<String> heldComments=new ArrayList<String>(1);
    while (streamReader.hasNext()) {
      XMLEvent nextEvent=streamReader.nextEvent();
      try {
switch (nextEvent.getEventType()) {
case XMLStreamConstants.START_ELEMENT:
{
            StartElement elem=nextEvent.asStartElement();
            String namespaceURI=elem.getName().getNamespaceURI();
            if ("String_Node_Str".equals(elem.getName().getLocalPart())) {
              Attribute urlAttr=elem.getAttributeByName(new QName("String_Node_Str"));
              String url;
              if (urlAttr == null || isBlank(urlAttr.getValue())) {
                getErrorHandler().missingRequiredElement(new ParseLocation("String_Node_Str"),"String_Node_Str");
                url=null;
              }
 else {
                url=urlAttr.getValue();
              }
              parserState.enteringNewElementExtension(elem,url,false,getServerBaseUrl());
            }
 else             if ("String_Node_Str".equals(elem.getName().getLocalPart())) {
              Attribute urlAttr=elem.getAttributeByName(new QName("String_Node_Str"));
              String url;
              if (urlAttr == null || isBlank(urlAttr.getValue())) {
                getErrorHandler().missingRequiredElement(new ParseLocation("String_Node_Str"),"String_Node_Str");
                url=null;
              }
 else {
                url=urlAttr.getValue();
              }
              parserState.enteringNewElementExtension(elem,url,true,getServerBaseUrl());
            }
 else {
              String elementName=elem.getName().getLocalPart();
              parserState.enteringNewElement(namespaceURI,elementName);
            }
            if (!heldComments.isEmpty()) {
              for (              String next : heldComments) {
                parserState.commentPre(next);
              }
              heldComments.clear();
            }
            @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=elem.getAttributes();
            for (Iterator<Attribute> iter=attributes; iter.hasNext(); ) {
              Attribute next=iter.next();
              parserState.attributeValue(next.getName().getLocalPart(),next.getValue());
            }
            break;
          }
case XMLStreamConstants.END_DOCUMENT:
case XMLStreamConstants.END_ELEMENT:
{
          if (!heldComments.isEmpty()) {
            for (            String next : heldComments) {
              parserState.commentPost(next);
            }
            heldComments.clear();
          }
          parserState.endingElement();
          break;
        }
case XMLStreamConstants.CHARACTERS:
{
        parserState.string(nextEvent.asCharacters().getData());
        break;
      }
case XMLStreamConstants.COMMENT:
{
      Comment comment=(Comment)nextEvent;
      String commentText=comment.getText();
      heldComments.add(commentText);
      break;
    }
}
parserState.xmlEvent(nextEvent);
}
 catch (DataFormatException e) {
throw new DataFormatException("String_Node_Str" + nextEvent.getLocation().toString() + "String_Node_Str"+ e.getMessage(),e);
}
}
return parserState.getObject();
}
 catch (XMLStreamException e) {
throw new DataFormatException(e);
}
}

Fixed version (ground truth):
private <T>T doXmlLoop(XMLEventReader streamReader,ParserState<T> parserState){
  ourLog.trace("String_Node_Str",parserState);
  try {
    List<String> heldComments=new ArrayList<String>(1);
    while (streamReader.hasNext()) {
      XMLEvent nextEvent=streamReader.nextEvent();
      try {
switch (nextEvent.getEventType()) {
case XMLStreamConstants.START_ELEMENT:
{
            StartElement elem=nextEvent.asStartElement();
            String namespaceURI=elem.getName().getNamespaceURI();
            if ("String_Node_Str".equals(elem.getName().getLocalPart())) {
              Attribute urlAttr=elem.getAttributeByName(new QName("String_Node_Str"));
              String url;
              if (urlAttr == null || isBlank(urlAttr.getValue())) {
                getErrorHandler().missingRequiredElement(new ParseLocation().setParentElementName("String_Node_Str"),"String_Node_Str");
                url=null;
              }
 else {
                url=urlAttr.getValue();
              }
              parserState.enteringNewElementExtension(elem,url,false,getServerBaseUrl());
            }
 else             if ("String_Node_Str".equals(elem.getName().getLocalPart())) {
              Attribute urlAttr=elem.getAttributeByName(new QName("String_Node_Str"));
              String url;
              if (urlAttr == null || isBlank(urlAttr.getValue())) {
                getErrorHandler().missingRequiredElement(new ParseLocation().setParentElementName("String_Node_Str"),"String_Node_Str");
                url=null;
              }
 else {
                url=urlAttr.getValue();
              }
              parserState.enteringNewElementExtension(elem,url,true,getServerBaseUrl());
            }
 else {
              String elementName=elem.getName().getLocalPart();
              parserState.enteringNewElement(namespaceURI,elementName);
            }
            if (!heldComments.isEmpty()) {
              for (              String next : heldComments) {
                parserState.commentPre(next);
              }
              heldComments.clear();
            }
            @SuppressWarnings("String_Node_Str") Iterator<Attribute> attributes=elem.getAttributes();
            for (Iterator<Attribute> iter=attributes; iter.hasNext(); ) {
              Attribute next=iter.next();
              parserState.attributeValue(next.getName().getLocalPart(),next.getValue());
            }
            break;
          }
case XMLStreamConstants.END_DOCUMENT:
case XMLStreamConstants.END_ELEMENT:
{
          if (!heldComments.isEmpty()) {
            for (            String next : heldComments) {
              parserState.commentPost(next);
            }
            heldComments.clear();
          }
          parserState.endingElement();
          break;
        }
case XMLStreamConstants.CHARACTERS:
{
        parserState.string(nextEvent.asCharacters().getData());
        break;
      }
case XMLStreamConstants.COMMENT:
{
      Comment comment=(Comment)nextEvent;
      String commentText=comment.getText();
      heldComments.add(commentText);
      break;
    }
}
parserState.xmlEvent(nextEvent);
}
 catch (DataFormatException e) {
throw new DataFormatException("String_Node_Str" + nextEvent.getLocation().toString() + "String_Node_Str"+ e.getMessage(),e);
}
}
return parserState.getObject();
}
 catch (XMLStreamException e) {
throw new DataFormatException(e);
}
}