nus-yam/ex-repair huggingface dataset:
Program: 94097
Project: 94097
Buggy source:
/** 
 * The default implementation of this method is to call id.namespaceToExternalForm(). Subclasses may override.
 * @param id the id in this Namespace to convert to external form.
 * @return String that represents the given id in an external form. Notethat this external form may at some later time be passed to {@link #createInstance(Object[])} as a single String parameter,and should result in a valid ID instance of the appropriate Namespace.
 */
protected String toExternalForm(BaseID id){
  return id.namespaceToExternalForm();
}

Fixed version (ground truth):
/** 
 * The default implementation of this method is to call id.namespaceToExternalForm(). Subclasses may override.
 * @param id the id in this Namespace to convert to external form.
 * @return String that represents the given id in an external form. Note thatthis external form may at some later time be passed to {@link #createInstance(Object[])} as a single String parameter, andshould result in a valid ID instance of the appropriate Namespace.
 */
protected String toExternalForm(BaseID id){
  return id.namespaceToExternalForm();
}
Program: 94098
Project: 94098
Buggy source:
/** 
 * @since 8.13
 */
public static String[] removeSupportedIntent(String intent,String[] currentSupportedIntents){
  if (intent == null)   return currentSupportedIntents;
  List<String> results=(currentSupportedIntents == null) ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(currentSupportedIntents));
  results.remove(intent);
  return results.toArray(new String[results.size()]);
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected static String[] removeSupportedIntent(String intent,String[] currentSupportedIntents){
  if (intent == null)   return currentSupportedIntents;
  List<String> results=(currentSupportedIntents == null) ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(currentSupportedIntents));
  results.remove(intent);
  return results.toArray(new String[results.size()]);
}
Program: 94099
Project: 94099
Buggy source:
/** 
 * @since 8.13
 */
public boolean checkPrivateIntent(ContainerTypeDescription description,String hostname,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(description,properties);
  if (serviceIntents != null && serviceIntents.contains(Constants.OSGI_PRIVATE_INTENT)) {
    checkPrivateHostname(description,hostname);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected boolean checkPrivateIntent(ContainerTypeDescription description,String hostname,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(properties);
  if (serviceIntents.contains(Constants.OSGI_PRIVATE_INTENT)) {
    if (!checkIntentSupported(description,Constants.OSGI_PRIVATE_INTENT))     throw new ContainerIntentException(Constants.OSGI_PRIVATE_INTENT,"String_Node_Str" + description.getName());
    checkPrivate(description,hostname);
  }
  return false;
}
Program: 94100
Project: 94100
Buggy source:
/** 
 * @since 8.13
 */
public static String[] addSupportedIntent(String intent,String[] currentSupportedIntents){
  if (intent == null)   return currentSupportedIntents;
  List<String> results=(currentSupportedIntents == null) ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(currentSupportedIntents));
  results.add(intent);
  return results.toArray(new String[results.size()]);
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected static String[] addSupportedIntent(String intent,String[] currentSupportedIntents){
  if (intent == null)   return currentSupportedIntents;
  List<String> results=(currentSupportedIntents == null) ? new ArrayList<String>() : new ArrayList<String>(Arrays.asList(currentSupportedIntents));
  results.add(intent);
  return results.toArray(new String[results.size()]);
}
Program: 94101
Project: 94101
Buggy source:
/** 
 * @since 8.13
 */
@SuppressWarnings("String_Node_Str") public boolean checkAsyncIntent(ContainerTypeDescription description,String hostname,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(description,properties);
  if (serviceIntents != null && serviceIntents.contains(Constants.OSGI_PRIVATE_INTENT))   return true;
  return false;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected boolean checkAsyncIntent(ContainerTypeDescription description,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(properties);
  if (serviceIntents.contains(Constants.OSGI_ASYNC_INTENT)) {
    if (!checkIntentSupported(description,Constants.OSGI_ASYNC_INTENT))     throw new ContainerIntentException(Constants.OSGI_ASYNC_INTENT,"String_Node_Str" + description.getName());
    return true;
  }
  return false;
}
Program: 94102
Project: 94102
Buggy source:
/** 
 * @since 8.13
 */
protected List<String> getServiceIntents(ContainerTypeDescription description,Map<String,?> properties){
  if (description != null) {
    String[] supportedIntents=getSupportedIntents(description);
    if (supportedIntents != null && properties != null)     return EndpointDescriptionPropertiesUtil.getStringPlusProperty(properties,Constants.OSGI_SERVICE_INTENTS);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected List<String> getServiceIntents(Map<String,?> properties){
  return EndpointDescriptionPropertiesUtil.getStringPlusProperty(properties,Constants.OSGI_SERVICE_INTENTS);
}
Program: 94103
Project: 94103
Buggy source:
/** 
 * @since 8.13
 */
public boolean checkConfidentialIntent(ContainerTypeDescription description,String uri,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(description,properties);
  if (serviceIntents != null && serviceIntents.contains(Constants.OSGI_CONFIDENTIAL_INTENT)) {
    checkConfidentialURI(description,uri);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected boolean checkConfidentialIntent(ContainerTypeDescription description,String uri,Map<String,?> properties) throws ContainerIntentException {
  List<String> serviceIntents=getServiceIntents(properties);
  if (serviceIntents.contains(Constants.OSGI_CONFIDENTIAL_INTENT)) {
    if (!checkIntentSupported(description,Constants.OSGI_CONFIDENTIAL_INTENT))     throw new ContainerIntentException(Constants.OSGI_CONFIDENTIAL_INTENT,"String_Node_Str" + description.getName());
    checkConfidential(description,uri);
  }
  return false;
}
Program: 94104
Project: 94104
Buggy source:
/** 
 * Invoke a remote call synchronously.  This method should block until a value may be returned, or the remote call has failed or timed out.
 * @param remoteCall the RSARemoteCall to synchronously invoke.  Will not be <code>null</code>.
 * @return the result (of appropriate type)
 * @throws ECFException if some exception occurred during invocation
 */
protected Object invokeSync(RSARemoteCall remoteCall) throws ECFException {
  if (remoteCall.getClass().isAssignableFrom(RSARemoteCall.class)) {
    Callable<Object> c=createSyncCallable(remoteCall);
    if (c == null)     throw new ECFException("String_Node_Str" + remoteCall.getMethod(),new NullPointerException("String_Node_Str"));
    try {
      return callSync(remoteCall,c);
    }
 catch (    InterruptedException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e);
    }
catch (    ExecutionException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e.getCause());
    }
catch (    TimeoutException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e);
    }
  }
  return super.invokeSync(remoteCall);
}

Fixed version (ground truth):
/** 
 * Invoke a remote call synchronously.  This method should block until a value may be returned, or the remote call has failed or timed out.
 * @param remoteCall the RSARemoteCall to synchronously invoke.  Will not be <code>null</code>.
 * @return the result (of appropriate type)
 * @throws ECFException if some exception occurred during invocation
 */
protected Object invokeSync(RSARemoteCall remoteCall) throws ECFException {
  if (remoteCall.getClass().isAssignableFrom(RSARemoteCall.class)) {
    Callable<Object> c=getSyncCallable(remoteCall);
    if (c == null)     throw new ECFException("String_Node_Str" + remoteCall.getMethod(),new NullPointerException("String_Node_Str"));
    try {
      return callSync(remoteCall,c);
    }
 catch (    InterruptedException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e);
    }
catch (    ExecutionException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e.getCause());
    }
catch (    TimeoutException e) {
      throw new ECFException("String_Node_Str" + remoteCall.getMethod(),e);
    }
  }
  return super.invokeSync(remoteCall);
}
Program: 94105
Project: 94105
Buggy source:
@Override public void callAsync(IRemoteCall call,IRemoteCallListener listener){
  if (call instanceof RSARemoteCall)   callAsyncWithTimeout(call,createAsyncCallable((RSARemoteCall)call),listener);
 else   super.callAsync(call,listener);
}

Fixed version (ground truth):
@Override public void callAsync(IRemoteCall call,IRemoteCallListener listener){
  if (call instanceof RSARemoteCall)   callAsyncWithTimeout(call,getAsyncCallable((RSARemoteCall)call),listener);
 else   super.callAsync(call,listener);
}
Program: 94106
Project: 94106
Buggy source:
@Override public Object callSync(IRemoteCall call) throws ECFException {
  if (call instanceof RSARemoteCall) {
    Callable<Object> c=createSyncCallable((RSARemoteCall)call);
    try {
      return c.call();
    }
 catch (    Exception e) {
      throw new ECFException("String_Node_Str" + call.getMethod(),e);
    }
  }
  return super.callSync(call);
}

Fixed version (ground truth):
@Override public Object callSync(IRemoteCall call) throws ECFException {
  if (call instanceof RSARemoteCall)   try {
    return getSyncCallable((RSARemoteCall)call).call();
  }
 catch (  Exception e) {
    throw new ECFException("String_Node_Str" + call.getMethod(),e);
  }
  return super.callSync(call);
}
Program: 94107
Project: 94107
Buggy source:
@Override public void callAsync(IRemoteCall call,IRemoteCallListener listener){
  if (call instanceof RSARemoteCall) {
    Callable<IRemoteCallCompleteEvent> c=createAsyncCallable((RSARemoteCall)call);
    if (c == null)     throw new NullPointerException("String_Node_Str");
    callAsyncWithTimeout(call,c,listener);
  }
 else   super.callAsync(call,listener);
}

Fixed version (ground truth):
@Override public void callAsync(IRemoteCall call,IRemoteCallListener listener){
  if (call instanceof RSARemoteCall) {
    Callable<IRemoteCallCompleteEvent> c=createAsyncCallable((RSARemoteCall)call);
    if (c != null)     callAsyncWithTimeout(call,c,listener);
  }
 else   super.callAsync(call,listener);
}
Program: 94108
Project: 94108
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  try {
    Object resultObject=invokeObject(proxy,method,args);
    if (resultObject != null)     return resultObject;
    try {
      if (isReturnAsync(proxy,method,args)) {
        if (isInterfaceAsync(method.getDeclaringClass()) && isMethodAsync(method.getName()))         return invokeAsync(createRemoteCall(proxy,method,getAsyncInvokeMethodName(method),args,getDefaultTimeout()));
        if (isOSGIAsync())         return invokeReturnAsync(proxy,method,args);
      }
    }
 catch (    Throwable t) {
      handleProxyException("String_Node_Str" + getRemoteServiceID(),t);
    }
    final String callMethod=getCallMethodNameForProxyInvoke(method,args);
    final Object[] callParameters=getCallParametersForProxyInvoke(callMethod,method,args);
    final long callTimeout=getCallTimeoutForProxyInvoke(callMethod,method,args);
    return invokeSync(createRemoteCall(proxy,method,callMethod,callParameters,callTimeout));
  }
 catch (  Throwable t) {
    if (t instanceof ServiceException)     throw t;
    throw new ServiceException("String_Node_Str" + getRemoteServiceID(),ServiceException.REMOTE,t);
  }
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  try {
    Object resultObject=invokeObject(proxy,method,args);
    if (resultObject != null)     return resultObject;
    try {
      if (isReturnAsync(proxy,method,args)) {
        if (isInterfaceAsync(method.getDeclaringClass()) && isMethodAsync(method.getName()))         return invokeAsync(createRemoteCall(proxy,method,getAsyncInvokeMethodName(method),args,getDefaultTimeout()));
        if (isOSGIAsync())         return invokeAsync(createRemoteCall(proxy,method,method.getName(),args,getDefaultTimeout()));
      }
    }
 catch (    Throwable t) {
      handleProxyException("String_Node_Str" + getRemoteServiceID(),t);
    }
    final String callMethod=getCallMethodNameForProxyInvoke(method,args);
    final Object[] callParameters=getCallParametersForProxyInvoke(callMethod,method,args);
    final long callTimeout=getCallTimeoutForProxyInvoke(callMethod,method,args);
    return invokeSync(createRemoteCall(proxy,method,callMethod,callParameters,callTimeout));
  }
 catch (  Throwable t) {
    if (t instanceof ServiceException)     throw t;
    throw new ServiceException("String_Node_Str" + getRemoteServiceID(),ServiceException.REMOTE,t);
  }
}
Program: 94109
Project: 94109
Buggy source:
/** 
 * @since 8.13
 */
protected Callable<IRemoteCallCompleteEvent> createAsyncCallable(final RSARemoteCall call){
  return null;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected Callable<IRemoteCallCompleteEvent> createAsyncCallable(final RSARemoteCall call){
  throw new UnsupportedOperationException("String_Node_Str" + call.getMethod() + "String_Node_Str"+ call.getReflectMethod().getDeclaringClass());
}
Program: 94110
Project: 94110
Buggy source:
/** 
 * @since 8.13
 */
protected Callable<Object> createSyncCallable(final RSARemoteCall call){
  return null;
}

Fixed version (ground truth):
/** 
 * @since 8.13
 */
protected Callable<Object> createSyncCallable(final RSARemoteCall call){
  throw new UnsupportedOperationException("String_Node_Str" + call.getMethod() + "String_Node_Str"+ call.getReflectMethod().getDeclaringClass());
}
Program: 94111
Project: 94111
Buggy source:
@Reference void bindTimeService(ITimeService timeService){
  System.out.println("String_Node_Str" + timeService);
  System.out.println("String_Node_Str" + timeService.getCurrentTime());
}

Fixed version (ground truth):
@Reference void bindTimeService(ITimeService timeService){
  System.out.println("String_Node_Str" + timeService.getCurrentTime());
}
Program: 94114
Project: 94114
Buggy source:
protected long getDefaultTimeout(){
synchronized (this) {
    if (defaultTimeout == null) {
      Object o=getRemoteServiceReference().getProperty(Constants.OSGI_BASIC_TIMEOUT_INTENT);
      if (o != null) {
        if (o instanceof Long)         defaultTimeout=(Long)o;
 else         if (o instanceof Integer)         defaultTimeout=((Integer)o).longValue();
 else         if (o instanceof String)         defaultTimeout=Long.valueOf((String)o);
      }
 else       defaultTimeout=IRemoteCall.DEFAULT_TIMEOUT;
    }
  }
  return defaultTimeout;
}

Fixed version (ground truth):
protected long getDefaultTimeout(){
synchronized (this) {
    if (defaultTimeout == null) {
      Object o=getRemoteServiceReference().getProperty(Constants.OSGI_BASIC_TIMEOUT_INTENT);
      if (o != null) {
        if (o instanceof Number)         defaultTimeout=((Number)o).longValue();
 else         if (o instanceof String)         defaultTimeout=Long.valueOf((String)o);
      }
 else       defaultTimeout=IRemoteCall.DEFAULT_TIMEOUT;
    }
  }
  return defaultTimeout;
}
Program: 94115
Project: 94115
Buggy source:
long getOSGiTimeout(){
  long timeout=30000;
  Object timeoutval=reference.getProperty(OSGI_BASIC_TIMEOUT);
  if (timeoutval != null) {
    if (timeoutval instanceof Long) {
      timeout=((Long)timeoutval).longValue();
    }
 else     if (timeoutval instanceof Integer) {
      timeout=((Integer)timeoutval).longValue();
    }
 else     if (timeoutval instanceof String) {
      timeout=Long.valueOf((String)timeoutval).longValue();
    }
  }
  return timeout;
}

Fixed version (ground truth):
long getOSGiTimeout(){
  long timeout=DEFAULT_TIMEOUT;
  Object timeoutval=reference.getProperty(OSGI_BASIC_TIMEOUT);
  if (timeoutval != null) {
    if (timeoutval instanceof Number)     timeout=((Number)timeoutval).longValue();
 else     if (timeoutval instanceof String)     timeout=Long.valueOf((String)timeoutval).longValue();
  }
  return timeout;
}
Program: 94116
Project: 94116
Buggy source:
@Descriptor("String_Node_Str") public RemoteServiceAdmin.ExportReference exportservice(CommandSession cs,@Descriptor("String_Node_Str") long serviceid,@Parameter(names={"String_Node_Str"},absentValue="String_Node_Str") @Descriptor("String_Node_Str") Map<String,?> map){
  ServiceReference<?> ref=null;
  try {
    ServiceReference<?>[] refs=context.getAllServiceReferences(null,"String_Node_Str" + Constants.SERVICE_ID + "String_Node_Str"+ String.valueOf(serviceid)+ "String_Node_Str");
    if (refs == null || refs.length < 1)     cs.getConsole().println("String_Node_Str" + String.valueOf(serviceid));
    ref=refs[0];
  }
 catch (  InvalidSyntaxException e) {
    e.printStackTrace(cs.getConsole());
    return null;
  }
  Map<String,Object> op=(map == null) ? new HashMap<String,Object>() : new HashMap<String,Object>(map);
  if (!op.containsKey(RemoteConstants.SERVICE_EXPORTED_INTERFACES))   op.put(RemoteConstants.SERVICE_EXPORTED_INTERFACES,"String_Node_Str");
  if (!op.containsKey(RemoteConstants.SERVICE_EXPORTED_CONFIGS))   op.put(RemoteConstants.SERVICE_EXPORTED_CONFIGS,DEFAULT_EXPORT_CONFIG);
  Collection<org.osgi.service.remoteserviceadmin.ExportRegistration> regs=getRSA().exportService(ref,op);
  if (regs != null)   for (  org.osgi.service.remoteserviceadmin.ExportRegistration reg : regs) {
    Throwable t=reg.getException();
    if (t != null)     t.printStackTrace(cs.getConsole());
 else {
      RemoteServiceAdmin.ExportReference er=(RemoteServiceAdmin.ExportReference)reg.getExportReference();
      if (er != null) {
        cs.getConsole().println("String_Node_Str" + String.valueOf(serviceid) + "String_Node_Str");
        return er;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Descriptor("String_Node_Str") public RemoteServiceAdmin.ExportReference exportservice(CommandSession cs,@Descriptor("String_Node_Str") long serviceid){
  return exportservice(cs,serviceid,null);
}
Program: 94117
Project: 94117
Buggy source:
@Descriptor("String_Node_Str") public String rsadebug(@Descriptor("String_Node_Str") boolean on){
  String msg=null;
synchronized (this) {
    if (debugReg == null) {
      if (on) {
        debugOn();
        msg="String_Node_Str";
      }
 else       msg="String_Node_Str";
    }
 else {
      if (debugReg != null) {
        debugOff();
        msg="String_Node_Str";
      }
 else       msg="String_Node_Str";
    }
  }
  return msg;
}

Fixed version (ground truth):
@Descriptor("String_Node_Str") public String rsadebug(@Descriptor("String_Node_Str") boolean on){
synchronized (this) {
    if (debugReg == null) {
      if (on) {
        debugOn();
        return "String_Node_Str";
      }
 else       return "String_Node_Str";
    }
 else {
      if (on) {
        return "String_Node_Str";
      }
 else {
        debugOff();
        return "String_Node_Str";
      }
    }
  }
}
Program: 94118
Project: 94118
Buggy source:
@Descriptor("String_Node_Str") public RemoteServiceAdmin.ExportReference updateservice(CommandSession cs,@Descriptor("String_Node_Str") String endpointid,@Descriptor("String_Node_Str") Map<String,?> map){
  RemoteServiceAdmin.ExportRegistration ereg=getExportRegistrationForId(endpointid);
  if (ereg == null) {
    cs.getConsole().println("String_Node_Str" + endpointid);
    return null;
  }
  RemoteServiceAdmin.ExportReference eref=(RemoteServiceAdmin.ExportReference)ereg.getExportReference();
  if (eref == null) {
    cs.getConsole().println("String_Node_Str" + endpointid + "String_Node_Str");
    return null;
  }
  ereg.update(map);
  return eref;
}

Fixed version (ground truth):
@Descriptor("String_Node_Str") public RemoteServiceAdmin.ExportReference updateservice(CommandSession cs,@Descriptor("String_Node_Str") String endpointid,@Descriptor("String_Node_Str") Map<String,?> map){
  RemoteServiceAdmin.ExportRegistration ereg=getExportRegistrationForId(endpointid);
  if (ereg == null) {
    cs.getConsole().println("String_Node_Str" + endpointid);
    return null;
  }
  RemoteServiceAdmin.ExportReference eref=(RemoteServiceAdmin.ExportReference)ereg.getExportReference();
  if (eref == null) {
    cs.getConsole().println("String_Node_Str" + endpointid + "String_Node_Str");
    return null;
  }
  ereg.update(map);
  cs.getConsole().println("String_Node_Str" + endpointid + "String_Node_Str");
  return eref;
}
Program: 94119
Project: 94119
Buggy source:
@Descriptor("String_Node_Str") public String rsadebug(@Descriptor("String_Node_Str") boolean on){
synchronized (this) {
    if (debugReg == null) {
      if (on) {
        debugOn();
        return "String_Node_Str";
      }
 else       return "String_Node_Str";
    }
 else {
      if (on) {
        return "String_Node_Str";
      }
 else {
        debugOff();
        return "String_Node_Str";
      }
    }
  }
}

Fixed version (ground truth):
@Descriptor("String_Node_Str") public String rsadebug(@Descriptor("String_Node_Str") boolean on){
synchronized (this) {
    if (debugReg == null) {
      if (on) {
        debugOn();
        return "String_Node_Str";
      }
 else       return "String_Node_Str";
    }
 else {
      if (on)       return "String_Node_Str";
 else {
        debugOff();
        return "String_Node_Str";
      }
    }
  }
}
Program: 94121
Project: 94121
Buggy source:
public synchronized long getRemoteServiceId(){
  EndpointDescription ed=getEndpointDescription();
  return (ed == null) ? 0 : ed.getRemoteServiceId();
}

Fixed version (ground truth):
public synchronized long getRemoteServiceId(){
  if (importEndpoint == null)   return 0;
  IRemoteServiceReference ref=importEndpoint.rsReference;
  if (ref == null)   return 0;
  return ref.getID().getContainerRelativeID();
}
Program: 94122
Project: 94122
Buggy source:
public boolean triggerDiscovery(){
  return false;
}

Fixed version (ground truth):
/** 
 * @return A DiscoveryLocator (Container)
 */
public boolean triggerDiscovery(){
  return false;
}
Program: 94123
Project: 94123
Buggy source:
/** 
 * called when the bundle is started.
 * @param context the bundle context.
 * @throws Exception not thrown.
 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
 */
public void start(final BundleContext context) throws Exception {
  instance=this;
  this.context=context;
  final ServiceReference logRef=context.getServiceReference("String_Node_Str");
  if (logRef != null) {
    RemoteOSGiServiceImpl.log=(LogService)context.getService(logRef);
  }
  if (remoting == null) {
    remoting=new RemoteOSGiServiceImpl();
  }
  context.registerService(new String[]{RemoteOSGiService.class.getName(),Remoting.class.getName()},remoting,null);
  if (!"String_Node_Str".equals(context.getProperty(RemoteOSGiServiceImpl.REGISTER_DEFAULT_TCP_CHANNEL))) {
    final Dictionary properties=new Hashtable();
    properties.put(NetworkChannelFactory.PROTOCOL_PROPERTY,TCPChannelFactory.PROTOCOL);
    context.registerService(NetworkChannelFactory.class.getName(),new TCPChannelFactory(),properties);
  }
}

Fixed version (ground truth):
/** 
 * called when the bundle is started.
 * @param context the bundle context.
 * @throws Exception not thrown.
 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
 */
public void start(final BundleContext context) throws Exception {
  instance=this;
  this.context=context;
  final ServiceReference logRef=context.getServiceReference("String_Node_Str");
  if (logRef != null) {
    RemoteOSGiServiceImpl.log=(LogService)context.getService(logRef);
  }
  if (DELETE_PROXY_BUNDLES_ON_INIT)   deleteProxyBundles(context);
  if (remoting == null) {
    remoting=new RemoteOSGiServiceImpl();
  }
  context.registerService(new String[]{RemoteOSGiService.class.getName(),Remoting.class.getName()},remoting,null);
  if (!"String_Node_Str".equals(context.getProperty(RemoteOSGiServiceImpl.REGISTER_DEFAULT_TCP_CHANNEL))) {
    final Dictionary properties=new Hashtable();
    properties.put(NetworkChannelFactory.PROTOCOL_PROPERTY,TCPChannelFactory.PROTOCOL);
    context.registerService(NetworkChannelFactory.class.getName(),new TCPChannelFactory(),properties);
  }
}
Program: 94124
Project: 94124
Buggy source:
public void open(){
  final IChatRoomManager manager=(IChatRoomManager)view.getRootChatRoomContainer();
  view.joinRoom(manager.getChatRoomInfo(channel),"String_Node_Str");
}

Fixed version (ground truth):
public void open(){
  IChatRoomContainer container=view.getRootChatRoomContainer();
  final IChatRoomManager manager=(IChatRoomManager)container.getAdapter(IChatRoomManager.class);
  view.joinRoom(manager.getChatRoomInfo(channel),"String_Node_Str");
}
Program: 94125
Project: 94125
Buggy source:
/** 
 * @param event the service event
 * @param listeners map of listeners
 * @since 3.0
 */
protected void handleEvent(ServiceEvent event,Map listeners){
switch (event.getType()) {
case ServiceEvent.MODIFIED:
    handleServiceModifying(event.getServiceReference());
  break;
case ServiceEvent.REGISTERED:
handleServiceRegistering(event.getServiceReference());
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * @param event the service event
 * @param listeners map of listeners
 * @since 3.0
 */
protected void handleEvent(ServiceEvent event,Map listeners){
switch (event.getType()) {
case ServiceEvent.MODIFIED:
    handleServiceModifying(event.getServiceReference());
  break;
case ServiceEvent.REGISTERED:
handleServiceRegistering(event.getServiceReference());
break;
case ServiceEvent.UNREGISTERING:
handleServiceUnregistering(event.getServiceReference());
break;
default :
break;
}
}
Program: 94126
Project: 94126
Buggy source:
private void stopProxyServiceFactoryBundle(){
  if (proxyServiceFactoryBundleContext != null) {
    try {
      proxyServiceFactoryBundleContext.getBundle().stop();
    }
 catch (    Exception e) {
    }
    proxyServiceFactoryBundleContext=null;
  }
  uninstallProxyBundles();
}

Fixed version (ground truth):
private void stopProxyServiceFactoryBundle(){
  if (proxyServiceFactoryBundleContext != null) {
    try {
      proxyServiceFactoryBundleContext.getBundle().stop();
    }
 catch (    Exception e) {
    }
    proxyServiceFactoryBundleContext=null;
  }
}
Program: 94127
Project: 94127
Buggy source:
public BundleContext getProxyServiceFactoryBundleContext(EndpointDescription endpointDescription){
  String edId=endpointDescription.getId();
  Bundle proxyBundle=null;
  final BundleContext bc=getContext();
  if (bc != null)   for (  Bundle b : bc.getBundles())   if (b.getSymbolicName().equals(edId)) {
    proxyBundle=b;
    break;
  }
  if (proxyBundle == null) {
    final Manifest mf=new Manifest();
    final Attributes attr=mf.getMainAttributes();
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str",new StringBuffer(RSA_PROXY_PREFIX).append(edId).toString());
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str","String_Node_Str");
    final ByteArrayOutputStream bout=new ByteArrayOutputStream();
    try {
      final JarOutputStream out=new JarOutputStream(bout,mf);
      out.flush();
      out.finish();
      out.close();
      proxyBundle=bc.installBundle(edId,new ByteArrayInputStream(bout.toByteArray()));
    }
 catch (    Throwable t) {
      LogUtility.logError("String_Node_Str",DebugOptions.REMOTE_SERVICE_ADMIN,Activator.class,"String_Node_Str",t);
    }
  }
  if (proxyBundle != null && proxyBundle.getState() != Bundle.ACTIVE) {
    try {
      proxyBundle.start();
    }
 catch (    BundleException e) {
      LogUtility.logError("String_Node_Str",DebugOptions.REMOTE_SERVICE_ADMIN,Activator.class,"String_Node_Str" + proxyBundle.getSymbolicName(),e);
    }
  }
  return (proxyBundle != null) ? proxyBundle.getBundleContext() : proxyServiceFactoryBundleContext;
}

Fixed version (ground truth):
public BundleContext getProxyServiceFactoryBundleContext(EndpointDescription endpointDescription){
  return proxyServiceFactoryBundleContext;
}
Program: 94128
Project: 94128
Buggy source:
private void initializeProxyServiceFactoryBundle() throws Exception {
  for (  Bundle b : context.getBundles()) {
    if (RSA_PROXY_BUNDLE_SYMBOLIC_ID.equals(b.getSymbolicName())) {
      b.start();
      proxyServiceFactoryBundleContext=b.getBundleContext();
    }
  }
  if (proxyServiceFactoryBundleContext == null)   throw new IllegalStateException("String_Node_Str" + RSA_PROXY_BUNDLE_SYMBOLIC_ID + "String_Node_Str");
  uninstallProxyBundles();
}

Fixed version (ground truth):
private void initializeProxyServiceFactoryBundle() throws Exception {
  for (  Bundle b : context.getBundles()) {
    if (RSA_PROXY_BUNDLE_SYMBOLIC_ID.equals(b.getSymbolicName())) {
      b.start();
      proxyServiceFactoryBundleContext=b.getBundleContext();
    }
  }
  if (proxyServiceFactoryBundleContext == null)   throw new IllegalStateException("String_Node_Str" + RSA_PROXY_BUNDLE_SYMBOLIC_ID + "String_Node_Str");
}
Program: 94129
Project: 94129
Buggy source:
private void stopProxyServiceFactoryBundle(){
  if (proxyServiceFactoryBundleContext != null) {
    try {
      proxyServiceFactoryBundleContext.getBundle().stop();
    }
 catch (    Exception e) {
    }
    proxyServiceFactoryBundleContext=null;
  }
}

Fixed version (ground truth):
private void stopProxyServiceFactoryBundle(){
  if (proxyServiceFactoryBundleContext != null) {
    try {
      proxyServiceFactoryBundleContext.getBundle().stop();
    }
 catch (    Exception e) {
    }
    proxyServiceFactoryBundleContext=null;
  }
  uninstallProxyBundles();
}
Program: 94130
Project: 94130
Buggy source:
public BundleContext getProxyServiceFactoryBundleContext(){
  return proxyServiceFactoryBundleContext;
}

Fixed version (ground truth):
public BundleContext getProxyServiceFactoryBundleContext(EndpointDescription endpointDescription){
  Bundle b=generateProxyBundle(endpointDescription);
  if (b != null)   return b.getBundleContext();
  return proxyServiceFactoryBundleContext;
}
Program: 94131
Project: 94131
Buggy source:
private void initializeProxyServiceFactoryBundle() throws Exception {
  for (  Bundle b : context.getBundles()) {
    if (RSA_PROXY_BUNDLE_SYMBOLIC_ID.equals(b.getSymbolicName())) {
      b.start();
      proxyServiceFactoryBundleContext=b.getBundleContext();
    }
  }
  if (proxyServiceFactoryBundleContext == null)   throw new IllegalStateException("String_Node_Str" + RSA_PROXY_BUNDLE_SYMBOLIC_ID + "String_Node_Str");
}

Fixed version (ground truth):
private void initializeProxyServiceFactoryBundle() throws Exception {
  for (  Bundle b : context.getBundles()) {
    if (RSA_PROXY_BUNDLE_SYMBOLIC_ID.equals(b.getSymbolicName())) {
      b.start();
      proxyServiceFactoryBundleContext=b.getBundleContext();
    }
  }
  if (proxyServiceFactoryBundleContext == null)   throw new IllegalStateException("String_Node_Str" + RSA_PROXY_BUNDLE_SYMBOLIC_ID + "String_Node_Str");
  uninstallProxyBundles();
}
Program: 94132
Project: 94132
Buggy source:
public BundleContext getProxyServiceFactoryBundleContext(EndpointDescription endpointDescription){
  Bundle b=generateProxyBundle(endpointDescription);
  if (b != null)   return b.getBundleContext();
  return proxyServiceFactoryBundleContext;
}

Fixed version (ground truth):
public BundleContext getProxyServiceFactoryBundleContext(EndpointDescription endpointDescription){
  String edId=endpointDescription.getId();
  Bundle proxyBundle=null;
  final BundleContext bc=getContext();
  if (bc != null)   for (  Bundle b : bc.getBundles())   if (b.getSymbolicName().equals(edId)) {
    proxyBundle=b;
    break;
  }
  if (proxyBundle == null) {
    final Manifest mf=new Manifest();
    final Attributes attr=mf.getMainAttributes();
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str",new StringBuffer(RSA_PROXY_PREFIX).append(edId).toString());
    attr.putValue("String_Node_Str","String_Node_Str");
    attr.putValue("String_Node_Str","String_Node_Str");
    final ByteArrayOutputStream bout=new ByteArrayOutputStream();
    try {
      final JarOutputStream out=new JarOutputStream(bout,mf);
      out.flush();
      out.finish();
      out.close();
      proxyBundle=bc.installBundle(edId,new ByteArrayInputStream(bout.toByteArray()));
    }
 catch (    Throwable t) {
      LogUtility.logError("String_Node_Str",DebugOptions.REMOTE_SERVICE_ADMIN,Activator.class,"String_Node_Str",t);
    }
  }
  if (proxyBundle != null && proxyBundle.getState() != Bundle.ACTIVE) {
    try {
      proxyBundle.start();
    }
 catch (    BundleException e) {
      LogUtility.logError("String_Node_Str",DebugOptions.REMOTE_SERVICE_ADMIN,Activator.class,"String_Node_Str" + proxyBundle.getSymbolicName(),e);
    }
  }
  return (proxyBundle != null) ? proxyBundle.getBundleContext() : proxyServiceFactoryBundleContext;
}
Program: 94133
Project: 94133
Buggy source:
ImportEndpoint(ID importContainerID,IRemoteServiceContainerAdapter rsContainerAdapter,IRemoteServiceReference rsReference,IRemoteService rs,IRemoteServiceListener rsListener,ServiceRegistration proxyRegistration,EndpointDescription endpointDescription){
  this.importContainerID=importContainerID;
  this.rsContainerAdapter=rsContainerAdapter;
  this.endpointDescription=endpointDescription;
  this.rsReference=rsReference;
  this.rs=rs;
  this.rsListener=rsListener;
  this.proxyRegistration=proxyRegistration;
  this.rsContainerAdapter.addRemoteServiceListener(this.rsListener);
}

Fixed version (ground truth):
ImportEndpoint(IRemoteServiceContainer rsContainer,IRemoteServiceReference rsReference,IRemoteService rs,ServiceRegistration proxyRegistration,EndpointDescription endpointDescription){
  this.rsContainer=rsContainer;
  this.rsReference=rsReference;
  this.endpointDescription=endpointDescription;
  this.rs=rs;
  this.proxyRegistration=proxyRegistration;
  this.rsListener=new RemoteServiceListener();
  this.rsContainer.getContainerAdapter().addRemoteServiceListener(this.rsListener);
}
Program: 94136
Project: 94136
Buggy source:
public static Map<String,Object> copySerializableProperties(Map<String,?> source,Map<String,Object> target){
  for (  String key : source.keySet()) {
    Object value=source.get(key);
    try {
      testSerializable(value);
      target.put(key,value);
    }
 catch (    Exception e) {
      LogUtility.logWarning("String_Node_Str",DebugOptions.EXCEPTIONS_CATCHING,PropertiesUtil.class,"String_Node_Str" + key + "String_Node_Str",e);
    }
  }
  return target;
}

Fixed version (ground truth):
public static Map<String,Object> copySerializableProperties(Map<String,?> source,Map<String,Object> target){
  if (source == null)   return target;
  for (  String key : source.keySet()) {
    Object value=source.get(key);
    try {
      testSerializable(value);
      target.put(key,value);
    }
 catch (    Exception e) {
      LogUtility.logWarning("String_Node_Str",DebugOptions.EXCEPTIONS_CATCHING,PropertiesUtil.class,"String_Node_Str" + key + "String_Node_Str",e);
    }
  }
  return target;
}
Program: 94137
Project: 94137
Buggy source:
public static ObjectInputStream create(BundleContext ctxt,InputStream ins) throws IOException {
  if (ctxt == null)   return new ObjectInputStream(ins);
  try {
    return new ClassResolverObjectInputStream(ctxt,ins,"String_Node_Str" + IClassResolver.BUNDLE_PROP_NAME + "String_Node_Str"+ ctxt.getBundle().getSymbolicName()+ "String_Node_Str");
  }
 catch (  SecurityException e) {
    throw new IOException("String_Node_Str",e);
  }
catch (  InvalidSyntaxException e) {
    throw new IOException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public static ObjectInputStream create(BundleContext ctxt,InputStream ins) throws IOException {
  return create(ctxt,ins,null);
}
Program: 94138
Project: 94138
Buggy source:
public EndpointDescriptionRSANode(EndpointDescription ed,ImportRegistration ir){
  this.endpointNode=(ir == null) ? new EndpointNode(ed) : new EndpointNode(ed,new org.eclipse.ecf.remoteserviceadmin.ui.endpoint.model.ImportRegistrationNode(ir));
  EndpointInterfacesNode ein=new EndpointInterfacesNode();
  for (  String intf : ed.getInterfaces())   ein.addChild(new EndpointPackageVersionNode(PropertyUtils.getPackageName(intf)));
  this.endpointNode.addChild(ein);
  List<String> aintfs=ed.getAsyncInterfaces();
  if (aintfs.size() > 0) {
    EndpointAsyncInterfacesNode ain=new EndpointAsyncInterfacesNode();
    for (    String intf : ed.getAsyncInterfaces())     ain.addChild(new EndpointPackageVersionNode(PropertyUtils.getPackageName(intf)));
    this.endpointNode.addChild(ain);
  }
  this.endpointNode.addChild(new EndpointIDNode());
  EndpointHostGroupNode idp=new EndpointHostGroupNode(Messages.EndpointDiscoveryView_REMOTE_HOST_NAME);
  idp.addChild(new EndpointNamespaceNode());
  idp.addChild(new EndpointRemoteServiceIDNode());
  org.eclipse.ecf.core.identity.ID connectTarget=ed.getConnectTargetID();
  if (connectTarget != null)   idp.addChild(new EndpointConnectTargetIDNode());
  idp.addChild(new EndpointServiceIDNode());
  idp.addChild(new EndpointIntentsNode());
  idp.addChild(new EndpointConfigTypesNode());
  idp.addChild(new EndpointFrameworkIDNode());
  idp.addChild(new EndpointTimestampNode());
  String filter=ed.getRemoteServiceFilter();
  if (filter != null)   idp.addChild(new EndpointRemoteServiceFilterNode());
  this.endpointNode.addChild(idp);
}

Fixed version (ground truth):
public EndpointDescriptionRSANode(EndpointDescription ed,ImportRegistration ir){
  this.endpointNode=(ir == null) ? new EndpointNode(ed) : new EndpointNode(ed,(ImportReference)ir.getImportReference());
  EndpointInterfacesNode ein=new EndpointInterfacesNode();
  for (  String intf : ed.getInterfaces())   ein.addChild(new EndpointPackageVersionNode(PropertyUtils.getPackageName(intf)));
  this.endpointNode.addChild(ein);
  List<String> aintfs=ed.getAsyncInterfaces();
  if (aintfs.size() > 0) {
    EndpointAsyncInterfacesNode ain=new EndpointAsyncInterfacesNode();
    for (    String intf : ed.getAsyncInterfaces())     ain.addChild(new EndpointPackageVersionNode(PropertyUtils.getPackageName(intf)));
    this.endpointNode.addChild(ain);
  }
  this.endpointNode.addChild(new EndpointIDNode());
  EndpointHostGroupNode idp=new EndpointHostGroupNode(Messages.EndpointDiscoveryView_REMOTE_HOST_NAME);
  idp.addChild(new EndpointNamespaceNode());
  idp.addChild(new EndpointRemoteServiceIDNode());
  org.eclipse.ecf.core.identity.ID connectTarget=ed.getConnectTargetID();
  if (connectTarget != null)   idp.addChild(new EndpointConnectTargetIDNode());
  idp.addChild(new EndpointServiceIDNode());
  idp.addChild(new EndpointIntentsNode());
  idp.addChild(new EndpointConfigTypesNode());
  idp.addChild(new EndpointFrameworkIDNode());
  idp.addChild(new EndpointTimestampNode());
  String filter=ed.getRemoteServiceFilter();
  if (filter != null)   idp.addChild(new EndpointRemoteServiceFilterNode());
  this.endpointNode.addChild(idp);
}
Program: 94139
Project: 94139
Buggy source:
/** 
 * @since 3.0
 */
protected void handleECFEndpointRemoved(org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription){
  trace("String_Node_Str","String_Node_Str" + endpointDescription);
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  List<RemoteServiceAdmin.ImportRegistration> importedRegistrations=rsa.getImportedRegistrations();
  org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed=(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)endpointDescription;
  for (  RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
    if (importedRegistration.match(ed)) {
      trace("String_Node_Str","String_Node_Str" + importedRegistration);
      importedRegistration.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * @since 3.0
 */
protected void handleECFEndpointRemoved(org.osgi.service.remoteserviceadmin.EndpointDescription endpointDescription){
  trace("String_Node_Str","String_Node_Str" + endpointDescription);
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  if (rsa != null) {
    List<RemoteServiceAdmin.ImportRegistration> importedRegistrations=rsa.getImportedRegistrations();
    org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed=(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)endpointDescription;
    for (    RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
      if (importedRegistration.match(ed)) {
        trace("String_Node_Str","String_Node_Str" + importedRegistration);
        importedRegistration.close();
      }
    }
  }
}
Program: 94140
Project: 94140
Buggy source:
protected void handleServiceUnregistering(ServiceReference serviceReference){
  List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations=((RemoteServiceAdmin)getRemoteServiceAdmin()).getExportedRegistrations();
  for (  RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
    if (exportedRegistration.match(serviceReference)) {
      trace("String_Node_Str","String_Node_Str" + serviceReference);
      exportedRegistration.close();
    }
  }
}

Fixed version (ground truth):
protected void handleServiceUnregistering(ServiceReference serviceReference){
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  if (rsa != null) {
    List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations=((RemoteServiceAdmin)getRemoteServiceAdmin()).getExportedRegistrations();
    for (    RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
      if (exportedRegistration.match(serviceReference)) {
        trace("String_Node_Str","String_Node_Str" + serviceReference);
        exportedRegistration.close();
      }
    }
  }
}
Program: 94141
Project: 94141
Buggy source:
/** 
 * @since 3.0
 */
protected void handleECFEndpointAdded(EndpointDescription endpointDescription){
  trace("String_Node_Str","String_Node_Str" + endpointDescription);
  getRemoteServiceAdmin().importService(endpointDescription);
}

Fixed version (ground truth):
/** 
 * @since 3.0
 */
protected void handleECFEndpointAdded(EndpointDescription endpointDescription){
  trace("String_Node_Str","String_Node_Str" + endpointDescription);
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  if (rsa != null)   rsa.importService(endpointDescription);
}
Program: 94142
Project: 94142
Buggy source:
/** 
 * @since 4.1
 */
protected void handleECFEndpointModified(EndpointDescription endpoint){
  trace("String_Node_Str","String_Node_Str" + endpoint);
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  List<RemoteServiceAdmin.ImportRegistration> importedRegistrations=rsa.getImportedRegistrations();
  org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed=(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)endpoint;
  for (  RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
    if (importedRegistration.match(ed)) {
      trace("String_Node_Str","String_Node_Str" + importedRegistration);
      importedRegistration.update(endpoint);
    }
  }
}

Fixed version (ground truth):
/** 
 * @since 4.1
 */
protected void handleECFEndpointModified(EndpointDescription endpoint){
  trace("String_Node_Str","String_Node_Str" + endpoint);
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  if (rsa != null) {
    List<RemoteServiceAdmin.ImportRegistration> importedRegistrations=rsa.getImportedRegistrations();
    org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription ed=(org.eclipse.ecf.osgi.services.remoteserviceadmin.EndpointDescription)endpoint;
    for (    RemoteServiceAdmin.ImportRegistration importedRegistration : importedRegistrations) {
      if (importedRegistration.match(ed)) {
        trace("String_Node_Str","String_Node_Str" + importedRegistration);
        importedRegistration.update(endpoint);
      }
    }
  }
}
Program: 94143
Project: 94143
Buggy source:
protected void handleServiceModifying(ServiceReference serviceReference){
  List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations=((RemoteServiceAdmin)getRemoteServiceAdmin()).getExportedRegistrations();
  for (  RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
    if (exportedRegistration.match(serviceReference)) {
      trace("String_Node_Str","String_Node_Str" + serviceReference);
      EndpointDescription updatedED=(EndpointDescription)exportedRegistration.update(null);
      if (updatedED == null)       logWarning("String_Node_Str","String_Node_Str" + exportedRegistration.getException());
    }
  }
}

Fixed version (ground truth):
protected void handleServiceModifying(ServiceReference serviceReference){
  RemoteServiceAdmin rsa=(RemoteServiceAdmin)getRemoteServiceAdmin();
  if (rsa != null) {
    List<RemoteServiceAdmin.ExportRegistration> exportedRegistrations=rsa.getExportedRegistrations();
    for (    RemoteServiceAdmin.ExportRegistration exportedRegistration : exportedRegistrations) {
      if (exportedRegistration.match(serviceReference)) {
        trace("String_Node_Str","String_Node_Str" + serviceReference);
        EndpointDescription updatedED=(EndpointDescription)exportedRegistration.update(null);
        if (updatedED == null)         logWarning("String_Node_Str","String_Node_Str" + exportedRegistration.getException());
      }
    }
  }
}
Program: 94144
Project: 94144
Buggy source:
protected void handleServiceRegistering(ServiceReference serviceReference){
  String[] exportedInterfaces=PropertiesUtil.getExportedInterfaces(serviceReference);
  if (exportedInterfaces == null)   return;
  String[] serviceExportedConfigs=PropertiesUtil.getStringArrayFromPropertyValue(serviceReference.getProperty(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_CONFIGS));
  if (requireServiceExportedConfigs && (serviceExportedConfigs == null || Arrays.asList(serviceExportedConfigs).size() == 0))   return;
  Map<String,Object> exportProperties=new TreeMap<String,Object>(String.CASE_INSENSITIVE_ORDER);
  exportProperties.put(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_INTERFACES,exportedInterfaces);
  trace("String_Node_Str","String_Node_Str" + serviceReference + "String_Node_Str"+ exportProperties);
  getRemoteServiceAdmin().exportService(serviceReference,exportProperties);
}

Fixed version (ground truth):
protected void handleServiceRegistering(ServiceReference serviceReference){
  String[] exportedInterfaces=PropertiesUtil.getExportedInterfaces(serviceReference);
  if (exportedInterfaces == null)   return;
  String[] serviceExportedConfigs=PropertiesUtil.getStringArrayFromPropertyValue(serviceReference.getProperty(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_CONFIGS));
  if (requireServiceExportedConfigs && (serviceExportedConfigs == null || Arrays.asList(serviceExportedConfigs).size() == 0))   return;
  Map<String,Object> exportProperties=new TreeMap<String,Object>(String.CASE_INSENSITIVE_ORDER);
  exportProperties.put(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_INTERFACES,exportedInterfaces);
  trace("String_Node_Str","String_Node_Str" + serviceReference + "String_Node_Str"+ exportProperties);
  org.osgi.service.remoteserviceadmin.RemoteServiceAdmin rsa=getRemoteServiceAdmin();
  if (rsa != null)   rsa.exportService(serviceReference,exportProperties);
}