Program: 17851
Project: 17851
Buggy source:
protected Object readStartedElement(final XMLStreamReader reader,final EntityPropertyInfo propertyInfo,final EntityTypeMapping typeMappings) throws EntityProviderException, EdmException {
  Map<String,Object> name2Value=new HashMap<String,Object>();
  Object result=null;
  try {
    reader.require(XMLStreamConstants.START_ELEMENT,Edm.NAMESPACE_D_2007_08,propertyInfo.getName());
    final String nullAttribute=reader.getAttributeValue(Edm.NAMESPACE_M_2007_08,FormatXml.M_NULL);
    if (TRUE.equals(nullAttribute)) {
      reader.nextTag();
    }
 else     if (propertyInfo.isComplex()) {
      reader.nextTag();
      while (reader.hasNext() && !reader.isEndElement()) {
        String childName=reader.getLocalName();
        EntityPropertyInfo childProperty=getChildProperty(childName,propertyInfo);
        Object value=readStartedElement(reader,childProperty,typeMappings.getEntityTypeMapping(propertyInfo.getName()));
        name2Value.put(childName,value);
        reader.nextTag();
      }
    }
 else {
      Class<?> mapping=typeMappings.getMappingClass(propertyInfo.getName());
      result=convert(propertyInfo,reader.getElementText(),mapping);
    }
    reader.require(XMLStreamConstants.END_ELEMENT,Edm.NAMESPACE_D_2007_08,propertyInfo.getName());
    if (result != null) {
      return result;
    }
 else     if (!name2Value.isEmpty()) {
      return name2Value;
    }
  }
 catch (  XMLStreamException e) {
    throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass().getSimpleName()),e);
  }
  return null;
}

Fixed version (ground truth):
protected Object readStartedElement(final XMLStreamReader reader,final EntityPropertyInfo propertyInfo,final EntityTypeMapping typeMappings) throws EntityProviderException, EdmException {
  Map<String,Object> name2Value=new HashMap<String,Object>();
  Object result=null;
  try {
    reader.require(XMLStreamConstants.START_ELEMENT,Edm.NAMESPACE_D_2007_08,propertyInfo.getName());
    final String nullAttribute=reader.getAttributeValue(Edm.NAMESPACE_M_2007_08,FormatXml.M_NULL);
    if (TRUE.equals(nullAttribute)) {
      reader.nextTag();
    }
 else     if (propertyInfo.isComplex()) {
      reader.nextTag();
      while (reader.hasNext() && !reader.isEndElement()) {
        String childName=reader.getLocalName();
        EntityPropertyInfo childProperty=getChildProperty(childName,propertyInfo);
        if (childProperty == null) {
          throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY.addContent(childName));
        }
        Object value=readStartedElement(reader,childProperty,typeMappings.getEntityTypeMapping(propertyInfo.getName()));
        name2Value.put(childName,value);
        reader.nextTag();
      }
    }
 else {
      Class<?> mapping=typeMappings.getMappingClass(propertyInfo.getName());
      result=convert(propertyInfo,reader.getElementText(),mapping);
    }
    reader.require(XMLStreamConstants.END_ELEMENT,Edm.NAMESPACE_D_2007_08,propertyInfo.getName());
    if (result != null) {
      return result;
    }
 else     if (!name2Value.isEmpty()) {
      return name2Value;
    }
  }
 catch (  XMLStreamException e) {
    throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass().getSimpleName()),e);
  }
  return null;
}