Program: 17830
Project: 17830
Buggy source:
private void appendInlineFeed(final XMLStreamWriter writer,final String navigationPropertyName,final EntityInfoAggregator eia,final Map<String,Object> data,final String self) throws EntityProviderException, XMLStreamException, EdmException, URISyntaxException {
  if (eia.getExpandedNavigationPropertyNames().contains(navigationPropertyName)) {
    if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
      writer.writeStartElement(Edm.NAMESPACE_M_2007_08,FormatXml.M_INLINE);
      EdmNavigationProperty navProp=(EdmNavigationProperty)eia.getEntityType().getProperty(navigationPropertyName);
      WriteFeedCallbackContext context=new WriteFeedCallbackContext();
      context.setSourceEntitySet(eia.getEntitySet());
      context.setNavigationProperty(navProp);
      context.setEntryData(data);
      ExpandSelectTreeNode subNode=properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
      context.setCurrentExpandSelectTreeNode(subNode);
      context.setSelfLink(new URI(self));
      ODataCallback callback=properties.getCallbacks().get(navigationPropertyName);
      if (callback == null) {
        throw new EntityProviderException(EntityProviderException.EXPANDNOTSUPPORTED);
      }
      WriteFeedCallbackResult result=null;
      try {
        result=((OnWriteFeedContent)callback).retrieveFeedResult(context);
      }
 catch (      ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.COMMON,e);
      }
      List<Map<String,Object>> inlineData=result.getFeedData();
      EntityProviderWriteProperties inlineProperties=result.getInlineProperties();
      EdmEntitySet inlineEntitySet=eia.getEntitySet().getRelatedEntitySet(navProp);
      AtomFeedProducer inlineFeedProducer=new AtomFeedProducer(inlineProperties);
      EntityInfoAggregator inlineEia=EntityInfoAggregator.create(inlineEntitySet,inlineProperties.getExpandSelectTree());
      inlineFeedProducer.append(writer,inlineEia,inlineData,true);
      writer.writeEndElement();
    }
  }
}

Fixed version (ground truth):
private void appendInlineFeed(final XMLStreamWriter writer,final String navigationPropertyName,final EntityInfoAggregator eia,final Map<String,Object> data,final String self) throws EntityProviderException, XMLStreamException, EdmException, URISyntaxException {
  if (eia.getExpandedNavigationPropertyNames().contains(navigationPropertyName)) {
    if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
      writer.writeStartElement(Edm.NAMESPACE_M_2007_08,FormatXml.M_INLINE);
      EdmNavigationProperty navProp=(EdmNavigationProperty)eia.getEntityType().getProperty(navigationPropertyName);
      WriteFeedCallbackContext context=new WriteFeedCallbackContext();
      context.setSourceEntitySet(eia.getEntitySet());
      context.setNavigationProperty(navProp);
      context.setEntryData(data);
      ExpandSelectTreeNode subNode=properties.getExpandSelectTree().getLinks().get(navigationPropertyName);
      context.setCurrentExpandSelectTreeNode(subNode);
      context.setSelfLink(new URI(self));
      ODataCallback callback=properties.getCallbacks().get(navigationPropertyName);
      if (callback == null) {
        throw new EntityProviderException(EntityProviderException.EXPANDNOTSUPPORTED);
      }
      WriteFeedCallbackResult result=null;
      try {
        result=((OnWriteFeedContent)callback).retrieveFeedResult(context);
      }
 catch (      ODataApplicationException e) {
        throw new EntityProviderException(EntityProviderException.COMMON,e);
      }
      List<Map<String,Object>> inlineData=result.getFeedData();
      if (inlineData == null) {
        inlineData=new ArrayList<Map<String,Object>>();
      }
      EntityProviderWriteProperties inlineProperties=result.getInlineProperties();
      EdmEntitySet inlineEntitySet=eia.getEntitySet().getRelatedEntitySet(navProp);
      AtomFeedProducer inlineFeedProducer=new AtomFeedProducer(inlineProperties);
      EntityInfoAggregator inlineEia=EntityInfoAggregator.create(inlineEntitySet,inlineProperties.getExpandSelectTree());
      inlineFeedProducer.append(writer,inlineEia,inlineData,true);
      writer.writeEndElement();
    }
  }
}