Program: 59573
Project: 59573
Buggy source:
public static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement,EdmDataServices metadata,EdmStructuralType structuralType){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceUri().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      EdmType et=null;
      if (typeAttribute != null) {
        String type=typeAttribute.getValue();
        et=metadata.resolveType(type);
        if (et == null) {
          throw new RuntimeException("String_Node_Str" + type);
        }
      }
 else {
        EdmProperty property=(EdmProperty)structuralType.findProperty(name);
        if (property != null)         et=property.getType();
 else         throw new RuntimeException("String_Node_Str" + name);
      }
      if (et != null && (!et.isSimple())) {
        EdmStructuralType est=(EdmStructuralType)et;
        op=OProperties.complex(name,(EdmComplexType)et,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement(),metadata,est)).toList());
      }
 else {
        op=OProperties.parseSimple(name,(EdmSimpleType<?>)et,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}

Fixed version (ground truth):
public static Iterable<OProperty<?>> parseProperties(XMLEventReader2 reader,StartElement2 propertiesElement,EdmDataServices metadata,EdmStructuralType structuralType){
  List<OProperty<?>> rt=new ArrayList<OProperty<?>>();
  while (reader.hasNext()) {
    XMLEvent2 event=reader.nextEvent();
    if (event.isEndElement() && event.asEndElement().getName().equals(propertiesElement.getName())) {
      return rt;
    }
    if (event.isStartElement() && event.asStartElement().getName().getNamespaceUri().equals(NS_DATASERVICES)) {
      String name=event.asStartElement().getName().getLocalPart();
      Attribute2 typeAttribute=event.asStartElement().getAttributeByName(M_TYPE);
      Attribute2 nullAttribute=event.asStartElement().getAttributeByName(M_NULL);
      boolean isNull=nullAttribute != null && "String_Node_Str".equals(nullAttribute.getValue());
      OProperty<?> op=null;
      EdmType et=null;
      if (typeAttribute != null) {
        String type=typeAttribute.getValue();
        et=metadata.resolveType(type);
        if (et == null) {
          throw new RuntimeException("String_Node_Str" + type);
        }
      }
 else {
        EdmProperty property=(EdmProperty)structuralType.findProperty(name);
        if (property != null)         et=property.getType();
 else         et=EdmSimpleType.STRING;
      }
      if (et != null && (!et.isSimple())) {
        EdmStructuralType est=(EdmStructuralType)et;
        op=OProperties.complex(name,(EdmComplexType)et,isNull ? null : Enumerable.create(parseProperties(reader,event.asStartElement(),metadata,est)).toList());
      }
 else {
        op=OProperties.parseSimple(name,(EdmSimpleType<?>)et,isNull ? null : reader.getElementText());
      }
      rt.add(op);
    }
  }
  throw new RuntimeException();
}