Program: 59580
Project: 59580
Buggy source:
private AtomEntry parseEntry(XMLEventReader2 reader,StartElement2 entryElement){
  String id=null;
  String categoryTerm=null;
  String categoryScheme=null;
  String title=null;
  String summary=null;
  String updated=null;
  String contentType=null;
  List<AtomLink> atomLinks=new ArrayList<AtomLink>();
  String etag=getAttributeValueIfExists(entryElement,M_ETAG);
  AtomEntry rt=null;
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(entryElement.getName())) {
      rt.id=id;
      rt.title=title;
      rt.summary=summary;
      rt.updated=updated;
      rt.categoryScheme=categoryScheme;
      rt.categoryTerm=categoryTerm;
      rt.contentType=contentType;
      rt.atomLinks=atomLinks;
      if (rt instanceof DataServicesAtomEntry) {
        DataServicesAtomEntry dsae=(DataServicesAtomEntry)rt;
        String entitySetName=this.entitySetName;
        if (rt.id != null && rt.id.endsWith("String_Node_Str"))         entitySetName=parseEntitySetName(rt.id);
        EdmEntitySet ees=metadata.findEdmEntitySet(entitySetName);
        if (ees == null) {
          EdmFunctionImport efi=metadata.findEdmFunctionImport(entitySetName);
          if (efi != null)           ees=efi.getEntitySet();
        }
        if (ees == null)         throw new RuntimeException("String_Node_Str" + rt.id);
        dsae.setOEntity(entityFromAtomEntry(metadata,ees,dsae,fcMapping));
      }
      return rt;
    }
    if (isStartElement(event,ATOM_ID)) {
      id=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_TITLE)) {
      title=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_SUMMARY)) {
      summary=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_UPDATED)) {
      updated=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_CATEGORY)) {
      categoryTerm=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
      categoryScheme=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
    }
 else     if (isStartElement(event,ATOM_LINK)) {
      AtomLink link=parseAtomLink(reader,event.asStartElement());
      atomLinks.add(link);
    }
 else     if (isStartElement(event,M_PROPERTIES)) {
      rt=parseDSAtomEntry(etag,reader,event);
    }
 else     if (isStartElement(event,ATOM_CONTENT)) {
      contentType=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
      if (contentType.equals(MediaType.APPLICATION_XML)) {
        StartElement2 contentElement=event.asStartElement();
        StartElement2 valueElement=null;
        while (reader.hasNext()) {
          XMLEvent2 event2=reader.nextEvent();
          if (valueElement == null && event2.isStartElement()) {
            valueElement=event2.asStartElement();
            if (isStartElement(event2,M_PROPERTIES)) {
              rt=parseDSAtomEntry(etag,reader,event2);
            }
 else {
              BasicAtomEntry bae=new BasicAtomEntry();
              bae.content=innerText(reader,event2.asStartElement());
              rt=bae;
            }
          }
          if (event2.isEndElement() && event2.asEndElement().getName().equals(contentElement.getName())) {
            break;
          }
        }
      }
 else {
        BasicAtomEntry bae=new BasicAtomEntry();
        bae.content=innerText(reader,event.asStartElement());
        rt=bae;
      }
    }
  }
  throw new RuntimeException();
}

Fixed version (ground truth):
private AtomEntry parseEntry(XMLEventReader2 reader,StartElement2 entryElement){
  String id=null;
  String categoryTerm=null;
  String categoryScheme=null;
  String title=null;
  String summary=null;
  String updated=null;
  String contentType=null;
  List<AtomLink> atomLinks=new ArrayList<AtomLink>();
  String etag=getAttributeValueIfExists(entryElement,M_ETAG);
  AtomEntry rt=null;
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(entryElement.getName())) {
      rt.id=id;
      rt.title=title;
      rt.summary=summary;
      rt.updated=updated;
      rt.categoryScheme=categoryScheme;
      rt.categoryTerm=categoryTerm;
      rt.contentType=contentType;
      rt.atomLinks=atomLinks;
      if (rt instanceof DataServicesAtomEntry) {
        DataServicesAtomEntry dsae=(DataServicesAtomEntry)rt;
        String entitySetName=this.entitySetName;
        if (rt.id != null && rt.id.endsWith("String_Node_Str"))         entitySetName=parseEntitySetName(rt.id);
        EdmEntitySet ees=metadata.findEdmEntitySet(entitySetName);
        if (ees == null) {
          EdmFunctionImport efi=metadata.findEdmFunctionImport(entitySetName);
          if (efi != null)           ees=efi.getEntitySet();
        }
        if (ees == null)         throw new RuntimeException("String_Node_Str" + rt.id);
        dsae.setOEntity(entityFromAtomEntry(metadata,ees,dsae,fcMapping));
      }
      return rt;
    }
    if (isStartElement(event,ATOM_ID)) {
      id=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_TITLE)) {
      title=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_SUMMARY)) {
      summary=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_UPDATED)) {
      updated=reader.getElementText();
    }
 else     if (isStartElement(event,ATOM_CATEGORY)) {
      categoryTerm=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
      categoryScheme=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
    }
 else     if (isStartElement(event,ATOM_LINK)) {
      AtomLink link=parseAtomLink(reader,event.asStartElement());
      atomLinks.add(link);
    }
 else     if (isStartElement(event,M_PROPERTIES)) {
      rt=parseDSAtomEntry(etag,reader,event);
    }
 else     if (isStartElement(event,ATOM_CONTENT)) {
      contentType=getAttributeValueIfExists(event.asStartElement(),"String_Node_Str");
      if (MediaType.APPLICATION_XML.equals(contentType)) {
        StartElement2 contentElement=event.asStartElement();
        StartElement2 valueElement=null;
        while (reader.hasNext()) {
          XMLEvent2 event2=reader.nextEvent();
          if (valueElement == null && event2.isStartElement()) {
            valueElement=event2.asStartElement();
            if (isStartElement(event2,M_PROPERTIES)) {
              rt=parseDSAtomEntry(etag,reader,event2);
            }
 else {
              BasicAtomEntry bae=new BasicAtomEntry();
              bae.content=innerText(reader,event2.asStartElement());
              rt=bae;
            }
          }
          if (event2.isEndElement() && event2.asEndElement().getName().equals(contentElement.getName())) {
            break;
          }
        }
      }
 else {
        BasicAtomEntry bae=new BasicAtomEntry();
        bae.content=innerText(reader,event.asStartElement());
        rt=bae;
      }
    }
  }
  throw new RuntimeException();
}