Program: 94170
Project: 94170
Buggy source:
private ExportRegistration exportService(final ServiceReference serviceReference,Map<String,?> overridingProperties,String[] exportedInterfaces,IRemoteServiceContainer rsContainer,Map<String,Object> endpointDescriptionProperties) throws Exception {
  Map remoteServiceProperties=copyNonReservedProperties(serviceReference,(Map<String,Object>)overridingProperties,new TreeMap<String,Object>(String.CASE_INSENSITIVE_ORDER));
  IRemoteServiceContainerAdapter containerAdapter=rsContainer.getContainerAdapter();
  IRemoteServiceRegistration remoteRegistration=null;
  if (containerAdapter instanceof IOSGiRemoteServiceContainerAdapter) {
    IOSGiRemoteServiceContainerAdapter osgiContainerAdapter=(IOSGiRemoteServiceContainerAdapter)containerAdapter;
    remoteRegistration=osgiContainerAdapter.registerRemoteService(exportedInterfaces,serviceReference,PropertiesUtil.createDictionaryFromMap(remoteServiceProperties));
  }
 else {
    Object service=AccessController.doPrivileged(new PrivilegedAction<Object>(){
      public Object run(){
        return getClientBundleContext().getService(serviceReference);
      }
    }
);
    remoteRegistration=containerAdapter.registerRemoteService(exportedInterfaces,service,PropertiesUtil.createDictionaryFromMap(remoteServiceProperties));
  }
  endpointDescriptionProperties.put(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID,remoteRegistration.getID().getContainerRelativeID());
  if (remoteRegistration instanceof IExtendedRemoteServiceRegistration) {
    IExtendedRemoteServiceRegistration iersr=(IExtendedRemoteServiceRegistration)remoteRegistration;
    Map<String,Object> extraProperties=iersr.getExtraProperties();
    if (extraProperties != null)     endpointDescriptionProperties=PropertiesUtil.mergeProperties(endpointDescriptionProperties,extraProperties);
  }
  return new ExportRegistration(new ExportEndpoint(serviceReference,new EndpointDescription(serviceReference,endpointDescriptionProperties),remoteRegistration));
}

Fixed version (ground truth):
private ExportRegistration exportService(final ServiceReference serviceReference,Map<String,?> overridingProperties,String[] exportedInterfaces,IRemoteServiceContainer rsContainer,Map<String,Object> endpointDescriptionProperties) throws Exception {
  Map remoteServiceProperties=copyNonReservedProperties(serviceReference,(Map<String,Object>)overridingProperties,new TreeMap<String,Object>(String.CASE_INSENSITIVE_ORDER));
  IRemoteServiceContainerAdapter containerAdapter=rsContainer.getContainerAdapter();
  IRemoteServiceRegistration remoteRegistration=null;
  if (containerAdapter instanceof IOSGiRemoteServiceContainerAdapter) {
    IOSGiRemoteServiceContainerAdapter osgiContainerAdapter=(IOSGiRemoteServiceContainerAdapter)containerAdapter;
    remoteRegistration=osgiContainerAdapter.registerRemoteService(exportedInterfaces,serviceReference,PropertiesUtil.createDictionaryFromMap(remoteServiceProperties));
  }
 else {
    Object service=AccessController.doPrivileged(new PrivilegedAction<Object>(){
      public Object run(){
        return getClientBundleContext().getService(serviceReference);
      }
    }
);
    remoteRegistration=containerAdapter.registerRemoteService(exportedInterfaces,service,PropertiesUtil.createDictionaryFromMap(remoteServiceProperties));
  }
  endpointDescriptionProperties.put(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID,remoteRegistration.getID().getContainerRelativeID());
  if (remoteRegistration instanceof IExtendedRemoteServiceRegistration) {
    IExtendedRemoteServiceRegistration iersr=(IExtendedRemoteServiceRegistration)remoteRegistration;
    Map<String,Object> extraProperties=iersr.getExtraProperties();
    if (extraProperties != null)     endpointDescriptionProperties=PropertiesUtil.mergeProperties(endpointDescriptionProperties,extraProperties);
  }
  return new ExportRegistration(new ExportEndpoint(serviceReference,new EndpointDescription(serviceReference,endpointDescriptionProperties),remoteRegistration,endpointDescriptionProperties));
}