nus-yam/ex-repair huggingface dataset:
Program: 94343
Project: 94343
Buggy source:
/** 
 * Creates a new polling input stream.
 * @param in the underlying input stream
 * @param numAttempts the number of attempts before issuing an InterruptedIOException, if 0, retries indefinitely until canceled
 * @param monitor the progress monitor to be polled for cancellation
 */
public PollingInputStream(InputStream in,int numAttempts,IProgressMonitor monitor){
  super(in);
  this.numAttempts=numAttempts;
  this.monitor=monitor;
  this.cancellable=true;
}

Fixed version (ground truth):
/** 
 * Creates a new polling input stream.
 * @param in the underlying input stream
 * @param numAttempts the number of attempts before issuing an InterruptedIOException, if 0, retries indefinitely until canceled
 * @param monitor the progress monitor to be polled for cancellation
 * @param readTimeoutMessage message to go with InteruptedIOException if read timeout
 * @param closeTimeoutMessage message to go with InteruptedIOException if close timeout
 * @since 3.1
 */
public PollingInputStream(InputStream in,int numAttempts,IProgressMonitor monitor,String readTimeoutMessage,String closeTimeoutMessage){
  super(in);
  this.numAttempts=numAttempts;
  this.monitor=monitor;
  this.cancellable=true;
  if (readTimeoutMessage != null)   this.readTimeoutMessage=readTimeoutMessage;
  if (closeTimeoutMessage != null)   this.closeTimeoutMessage=closeTimeoutMessage;
}
Program: 94344
Project: 94344
Buggy source:
/** 
 * Wraps the underlying stream's method.
 * @param count - the number of bytes to be skipped.
 * @return the actual number of bytes skipped.
 * @throws OperationCanceledException if the progress monitor is canceled
 * @throws InterruptedIOException if the underlying operation times out numAttempts times and no data was received, bytesTransferred will be zero
 * @throws IOException if an i/o error occurs
 */
public long skip(long count) throws IOException {
  int attempts=0;
  for (; ; ) {
    if (checkCancellation())     throw new OperationCanceledException();
    try {
      return in.skip(count);
    }
 catch (    InterruptedIOException e) {
      if (e.bytesTransferred != 0)       return e.bytesTransferred;
      if (++attempts == numAttempts)       throw new InterruptedIOException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Wraps the underlying stream's method.
 * @param count - the number of bytes to be skipped.
 * @return the actual number of bytes skipped.
 * @throws OperationCanceledException if the progress monitor is canceled
 * @throws InterruptedIOException if the underlying operation times out numAttempts times and no data was received, bytesTransferred will be zero
 * @throws IOException if an i/o error occurs
 */
public long skip(long count) throws IOException {
  int attempts=0;
  for (; ; ) {
    if (checkCancellation())     throw new OperationCanceledException();
    try {
      return in.skip(count);
    }
 catch (    InterruptedIOException e) {
      if (e.bytesTransferred != 0)       return e.bytesTransferred;
      if (++attempts == numAttempts)       throw new InterruptedIOException(readTimeoutMessage);
    }
  }
}
Program: 94345
Project: 94345
Buggy source:
/** 
 * Wraps the underlying stream's method. It may be important to wait for an input stream to be closed because it holds an implicit lock on a system resource (such as a file) while it is open. Closing a stream may take time if the underlying stream is still servicing a previous request.
 * @throws OperationCanceledException if the progress monitor is canceled
 * @throws InterruptedIOException if the underlying operation times out numAttempts times
 */
public void close() throws InterruptedIOException {
  int attempts=0;
  try {
    readPendingInput();
  }
 catch (  IOException e) {
    logError(e.getMessage(),e);
  }
 finally {
    boolean stop=false;
    while (!stop) {
      try {
        if (in != null)         in.close();
        stop=true;
      }
 catch (      InterruptedIOException e) {
        if (checkCancellation())         throw new OperationCanceledException();
        if (++attempts == numAttempts)         throw new InterruptedIOException("String_Node_Str");
      }
catch (      IOException e) {
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Wraps the underlying stream's method. It may be important to wait for an input stream to be closed because it holds an implicit lock on a system resource (such as a file) while it is open. Closing a stream may take time if the underlying stream is still servicing a previous request.
 * @throws OperationCanceledException if the progress monitor is canceled
 * @throws InterruptedIOException if the underlying operation times out numAttempts times
 */
public void close() throws InterruptedIOException {
  int attempts=0;
  try {
    readPendingInput();
  }
 catch (  IOException e) {
    logError(e.getMessage(),e);
  }
 finally {
    boolean stop=false;
    while (!stop) {
      try {
        if (in != null)         in.close();
        stop=true;
      }
 catch (      InterruptedIOException e) {
        if (checkCancellation())         throw new OperationCanceledException();
        if (++attempts == numAttempts)         throw new InterruptedIOException(closeTimeoutMessage);
      }
catch (      IOException e) {
      }
    }
  }
}
Program: 94346
Project: 94346
Buggy source:
/** 
 * @since 3.3 for preventing issues like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304427
 */
protected void connectToRemoteServiceTarget(ID targetID) throws ContainerConnectException {
synchronized (rsConnectLock) {
    ISharedObjectContext context=getContext();
    if (context == null)     throw new ContainerConnectException("String_Node_Str");
    ID connectedID=context.getConnectedID();
    if (connectedID != null) {
      if (connectedID.equals(targetID))       return;
      throw new ContainerConnectException("String_Node_Str" + connectedID);
    }
    context.connect(targetID,connectContext);
    waitForConnectedEvent(context,targetID);
  }
}

Fixed version (ground truth):
/** 
 * @since 3.3 for preventing issues like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304427
 */
protected void connectToRemoteServiceTarget(ID targetID) throws ContainerConnectException {
synchronized (rsConnectLock) {
    ISharedObjectContext context=getContext();
    if (context == null)     throw new ContainerConnectException("String_Node_Str");
    ID connectedID=context.getConnectedID();
    if (connectedID != null)     return;
    context.connect(targetID,connectContext);
    waitForConnectedEvent(context,targetID);
  }
}
Program: 94347
Project: 94347
Buggy source:
protected void sendUnregister(RemoteServiceRegistrationImpl serviceRegistration){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",new Object[]{serviceRegistration});
synchronized (localRegistry) {
    localRegistry.unpublishService(serviceRegistration);
    final ID containerID=serviceRegistration.getContainerID();
    final Long serviceId=new Long(serviceRegistration.getServiceId());
    try {
      this.sendSharedObjectMsgTo(null,SharedObjectMsg.createMsg(UNREGISTER,new Object[]{containerID,serviceId}));
    }
 catch (    final IOException e) {
      log(UNREGISTER_ERROR_CODE,UNREGISTER_ERROR_MESSAGE,e);
    }
  }
  fireRemoteServiceListeners(createUnregisteredEvent(serviceRegistration));
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}

Fixed version (ground truth):
protected void sendUnregister(RemoteServiceRegistrationImpl serviceRegistration){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",new Object[]{serviceRegistration});
synchronized (localRegistry) {
    localRegistry.unpublishService(serviceRegistration);
    final ID containerID=serviceRegistration.getContainerID();
    final Long serviceId=new Long(serviceRegistration.getServiceId());
    ID[] targetIds=getTargetsFromProperties(serviceRegistration.properties);
    if (targetIds == null) {
      try {
        this.sendSharedObjectMsgTo(null,SharedObjectMsg.createMsg(UNREGISTER,new Object[]{containerID,serviceId}));
      }
 catch (      final IOException e) {
        log(UNREGISTER_ERROR_CODE,UNREGISTER_ERROR_MESSAGE,e);
      }
    }
 else     for (int i=0; i < targetIds.length; i++) {
      try {
        this.sendSharedObjectMsgTo(targetIds[i],SharedObjectMsg.createMsg(UNREGISTER,new Object[]{containerID,serviceId}));
      }
 catch (      final IOException e) {
        log(UNREGISTER_ERROR_CODE,UNREGISTER_ERROR_MESSAGE,e);
      }
    }
  }
  fireRemoteServiceListeners(createUnregisteredEvent(serviceRegistration));
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}
Program: 94348
Project: 94348
Buggy source:
protected ID[] getTargetsFromProperties(Dictionary properties){
  return null;
}

Fixed version (ground truth):
protected ID[] getTargetsFromProperties(Dictionary properties){
  if (properties == null)   return null;
  List results=new ArrayList();
  Object o=properties.get(Constants.SERVICE_REGISTRATION_TARGETS);
  if (o != null) {
    if (o instanceof ID)     results.add(o);
    if (o instanceof ID[]) {
      ID[] targets=(ID[])o;
      for (int i=0; i < targets.length; i++)       results.add(targets[i]);
    }
  }
  if (results.size() == 0)   return null;
  return (ID[])results.toArray(new ID[]{});
}
Program: 94349
Project: 94349
Buggy source:
protected IRemoteServiceReference[] getRemoteServiceReferences(IRemoteServiceContainerAdapter adapter,String clazz,String filter){
  try {
    return adapter.getRemoteServiceReferences(new ID[]{getClient(0).getConnectedID()},clazz,filter);
  }
 catch (  final InvalidSyntaxException e) {
    fail("String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
protected IRemoteServiceReference[] getRemoteServiceReferences(IRemoteServiceContainerAdapter adapter,String clazz,String filter){
  try {
    return adapter.getRemoteServiceReferences((ID[])null,clazz,filter);
  }
 catch (  final InvalidSyntaxException e) {
    fail("String_Node_Str");
  }
  return null;
}
Program: 94350
Project: 94350
Buggy source:
protected IServiceTypeID createServiceTypeID(Map servicePublicationProperties,Namespace aNamespace) throws IDCreateException {
  String namingAuthority=getPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.NAMING_AUTHORITY,IServiceTypeID.DEFAULT_NA);
  String scope=getPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.SCOPE,IServiceTypeID.DEFAULT_SCOPE[0]);
  String protocol=getPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.SERVICE_PROTOCOL,IServiceTypeID.DEFAULT_PROTO[0]);
  return ServiceIDFactory.getDefault().createServiceTypeID(aNamespace,new String[]{RemoteServicePublication.SERVICE_TYPE},new String[]{scope},new String[]{protocol},namingAuthority);
}

Fixed version (ground truth):
protected IServiceTypeID createServiceTypeID(Map servicePublicationProperties,Namespace aNamespace) throws IDCreateException {
  String namingAuthority=getPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.NAMING_AUTHORITY,IServiceTypeID.DEFAULT_NA);
  String[] scopes=getStringArrayPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.SCOPE,IServiceTypeID.DEFAULT_SCOPE[0]);
  String[] protocols=getStringArrayPropertyWithDefault(servicePublicationProperties,RemoteServicePublication.SERVICE_PROTOCOL,IServiceTypeID.DEFAULT_PROTO[0]);
  return ServiceIDFactory.getDefault().createServiceTypeID(aNamespace,new String[]{RemoteServicePublication.SERVICE_TYPE},scopes,protocols,namingAuthority);
}
Program: 94352
Project: 94352
Buggy source:
protected HttpMethod createAndPrepareHttpMethod(String uri,IRemoteCall call,IRemoteCallable callable) throws RestException {
  HttpMethod httpMethod=null;
  IRemoteCallableRequestType requestType=callable.getRequestType();
  if (requestType == null)   throw new RestException("String_Node_Str");
  try {
    if (requestType instanceof HttpGetRequestType) {
      httpMethod=prepareGetMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpPostRequestType) {
      httpMethod=preparePostMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpPutRequestType) {
      httpMethod=preparePutMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpDeleteRequestType) {
      httpMethod=prepareDeleteMethod(uri,call,callable);
    }
 else {
      throw new RestException(NLS.bind("String_Node_Str",requestType));
    }
  }
 catch (  NotSerializableException e) {
    throw new RestException("String_Node_Str" + uri + "String_Node_Str"+ call+ "String_Node_Str"+ callable);
  }
  addRequestHeaders(httpMethod,call,callable);
  setupAuthenticaton(httpClient,httpMethod);
  httpClient.getParams().setParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS,new Boolean(true));
  setupTimeouts(httpClient,call,callable);
  return httpMethod;
}

Fixed version (ground truth):
protected HttpMethod createAndPrepareHttpMethod(String uri,IRemoteCall call,IRemoteCallable callable) throws RestException {
  HttpMethod httpMethod=null;
  IRemoteCallableRequestType requestType=callable.getRequestType();
  if (requestType == null)   throw new RestException("String_Node_Str");
  try {
    if (requestType instanceof HttpGetRequestType) {
      httpMethod=prepareGetMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpPostRequestType) {
      httpMethod=preparePostMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpPutRequestType) {
      httpMethod=preparePutMethod(uri,call,callable);
    }
 else     if (requestType instanceof HttpDeleteRequestType) {
      httpMethod=prepareDeleteMethod(uri,call,callable);
    }
 else {
      throw new RestException(NLS.bind("String_Node_Str",requestType));
    }
  }
 catch (  NotSerializableException e) {
    throw new RestException("String_Node_Str" + uri + "String_Node_Str"+ call+ "String_Node_Str"+ callable);
  }
  addRequestHeaders(httpMethod,call,callable);
  setupAuthenticaton(httpClient,httpMethod);
  httpClient.getParams().setParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS,new Boolean(true));
  httpClient.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,DEFAULT_HTTP_CONTENT_CHARSET);
  setupTimeouts(httpClient,call,callable);
  return httpMethod;
}
Program: 94353
Project: 94353
Buggy source:
public void testGetServiceReferencesWithFilter() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  final Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  registerService(adapters[0],IConcatService.class.getName(),createService(),customizeProperties(props),0);
  final IRemoteServiceReference[] refs=getRemoteServiceReferences(adapters[1],(ID)null,IConcatService.class.getName(),getFilterFromServiceProperties(customizeProperties(props)));
  assertTrue(refs != null);
  assertTrue(refs.length > 0);
}

Fixed version (ground truth):
public void testGetServiceReferencesWithFilter() throws Exception {
  final IRemoteServiceContainerAdapter[] adapters=getRemoteServiceAdapters();
  final Properties props=new Properties();
  props.put("String_Node_Str","String_Node_Str");
  props.put("String_Node_Str","String_Node_Str");
  registerService(adapters[0],IConcatService.class.getName(),createService(),customizeProperties(props),0);
  final IRemoteServiceReference[] refs=getRemoteServiceReferences(adapters[1],(ID)null,IConcatService.class.getName(),getFilterFromServiceProperties(props));
  assertTrue(refs != null);
  assertTrue(refs.length > 0);
}
Program: 94355
Project: 94355
Buggy source:
private URI createURI(ID endpointContainerID) throws URISyntaxException {
  boolean done=false;
  URI uri=null;
  String str=endpointContainerID.getName();
  while (!done) {
    try {
      uri=new URI(str);
      if (!uri.isOpaque()) {
        done=true;
      }
 else {
        str=uri.getRawSchemeSpecificPart();
      }
    }
 catch (    URISyntaxException e) {
      done=true;
    }
  }
  String scheme=RemoteServicePublication.SERVICE_TYPE;
  int port=32565;
  if (uri != null) {
    port=uri.getPort();
    if (port == -1)     port=32565;
  }
  String host=null;
  try {
    host=InetAddress.getLocalHost().getHostAddress();
  }
 catch (  Exception e) {
    host="String_Node_Str";
  }
  return new URI(scheme,null,host,port,null,null,null);
}

Fixed version (ground truth):
private URI createURI(ID endpointContainerID,String path) throws URISyntaxException {
  boolean done=false;
  URI uri=null;
  String str=endpointContainerID.getName();
  while (!done) {
    try {
      uri=new URI(str);
      if (!uri.isOpaque()) {
        done=true;
      }
 else {
        str=uri.getRawSchemeSpecificPart();
      }
    }
 catch (    URISyntaxException e) {
      done=true;
    }
  }
  String scheme=RemoteServicePublication.SERVICE_TYPE;
  int port=32565;
  if (uri != null) {
    port=uri.getPort();
    if (port == -1)     port=32565;
  }
  String host=null;
  try {
    host=InetAddress.getLocalHost().getHostAddress();
  }
 catch (  Exception e) {
    host="String_Node_Str";
  }
  return new URI(scheme,null,host,port,path,null,null);
}
Program: 94356
Project: 94356
Buggy source:
public long getRemoteServiceId(){
  byte[] remoteServiceIdAsBytes=(byte[])serviceProperties.get(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID);
  if (remoteServiceIdAsBytes == null)   return 0;
 else {
    Long remoteServiceId=new Long(new String(remoteServiceIdAsBytes));
    return remoteServiceId.longValue();
  }
}

Fixed version (ground truth):
public long getRemoteServiceId(){
  byte[] remoteServiceIdAsBytes=(byte[])serviceProperties.get(org.eclipse.ecf.remoteservice.Constants.SERVICE_ID);
  if (remoteServiceIdAsBytes == null)   return -1;
 else {
    Long remoteServiceId=new Long(new String(remoteServiceIdAsBytes));
    return remoteServiceId.longValue();
  }
}
Program: 94357
Project: 94357
Buggy source:
public static void logNoProxyWarning(Throwable e){
  getDefault().log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
}

Fixed version (ground truth):
public static void logNoProxyWarning(Throwable e){
  Activator a=getDefault();
  if (a != null) {
    a.log(new Status(IStatus.WARNING,Activator.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
  }
}
Program: 94358
Project: 94358
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      proxy=ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
    }
 catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94359
Project: 94359
Buggy source:
/** 
 * Select a single proxy from a set of proxies available for the given host.  This implementation selects in the following manner:  1) If proxies provided is null or array of 0 length, null  is returned.  If only one proxy is available (array of length 1) then the entry is returned. If proxies provided is length > 1, then if the type of a proxy in the array matches the given protocol (e.g. http, https), then the first matching proxy is returned.  If the protocol does not match any of the proxies, then the *first* proxy (i.e. proxies[0]) is returned.  Subclasses may override if desired.
 * @param protocol the target protocol (e.g. http, https, scp, etc).  Will not be <code>null</code>.
 * @param proxies the proxies to select from.  May be <code>null</code> or array of length 0.
 * @return proxy data selected from the proxies provided.  
 */
protected IProxyData selectProxyFromProxies(String protocol,IProxyData[] proxies){
  return ProxySetupHelper.selectProxyFromProxies(protocol,proxies);
}

Fixed version (ground truth):
/** 
 * Select a single proxy from a set of proxies available for the given host.  This implementation selects in the following manner:  1) If proxies provided is null or array of 0 length, null  is returned.  If only one proxy is available (array of length 1) then the entry is returned. If proxies provided is length > 1, then if the type of a proxy in the array matches the given protocol (e.g. http, https), then the first matching proxy is returned.  If the protocol does not match any of the proxies, then the *first* proxy (i.e. proxies[0]) is returned.  Subclasses may override if desired.
 * @param protocol the target protocol (e.g. http, https, scp, etc).  Will not be <code>null</code>.
 * @param proxies the proxies to select from.  May be <code>null</code> or array of length 0.
 * @return proxy data selected from the proxies provided.  
 */
protected IProxyData selectProxyFromProxies(String protocol,IProxyData[] proxies){
  try {
    return ProxySetupHelper.selectProxyFromProxies(protocol,proxies);
  }
 catch (  NoClassDefFoundError e) {
    Activator.logNoProxyWarning(e);
    return null;
  }
}
Program: 94360
Project: 94360
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
    }
 catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94361
Project: 94361
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
    }
 catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94362
Project: 94362
Buggy source:
private String[] getExportedInterfaces(ServiceReference serviceReference){
  Object propValue=serviceReference.getProperty(IDistributionConstants.SERVICE_EXPORTED_INTERFACES);
  if (propValue == null)   return null;
  boolean wildcard=false;
  String[] exportedInterfaces=null;
  if (propValue instanceof String) {
    wildcard=propValue.equals(IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
    if (!wildcard)     return null;
    exportedInterfaces=new String[]{(String)propValue};
  }
  if (exportedInterfaces == null && propValue instanceof String[]) {
    exportedInterfaces=(String[])propValue;
  }
  if (exportedInterfaces == null)   return null;
  String[] serviceInterfaces=(String[])serviceReference.getProperty(org.osgi.framework.Constants.OBJECTCLASS);
  List results=new ArrayList();
  if (wildcard) {
    return serviceInterfaces;
  }
 else {
    List interfaces=Arrays.asList(serviceInterfaces);
    List rsInterfaces=Arrays.asList(exportedInterfaces);
    for (Iterator i=rsInterfaces.iterator(); i.hasNext(); ) {
      String rsIntf=(String)i.next();
      if (rsIntf.equals(IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD))       results.addAll(interfaces);
      if (interfaces.contains(rsIntf))       results.add(rsIntf);
    }
  }
  if (results.size() == 0)   return null;
  return (String[])results.toArray(new String[]{});
}

Fixed version (ground truth):
private String[] getExportedInterfaces(ServiceReference serviceReference){
  Object propValue=serviceReference.getProperty(IDistributionConstants.SERVICE_EXPORTED_INTERFACES);
  if (propValue == null)   return null;
  boolean wildcard=propValue.equals(IDistributionConstants.SERVICE_EXPORTED_INTERFACES_WILDCARD);
  if (wildcard)   return (String[])serviceReference.getProperty(org.osgi.framework.Constants.OBJECTCLASS);
 else   return getStringArrayFromPropertyValue(propValue);
}
Program: 94364
Project: 94364
Buggy source:
private ServiceRegistration[] removeProxyServiceRegistrations(RemoteServiceEndpointDescription sed){
  List results=new ArrayList();
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    ServiceRegistration sr=reg.removeServiceRegistration(sed);
    if (reg != null) {
      results.add(sr);
      if (reg.isEmpty()) {
        reg.dispose();
        discoveredRemoteServiceRegistrations.remove(containerID);
      }
    }
  }
  return (ServiceRegistration[])results.toArray(new ServiceRegistration[]{});
}

Fixed version (ground truth):
private ServiceRegistration[] removeProxyServiceRegistrations(RemoteServiceEndpointDescription sed){
  List results=new ArrayList();
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    if (reg != null) {
      ServiceRegistration sr=reg.removeServiceRegistration(sed);
      if (sr != null)       results.add(sr);
      if (reg.isEmpty()) {
        reg.dispose();
        discoveredRemoteServiceRegistrations.remove(containerID);
      }
    }
  }
  return (ServiceRegistration[])results.toArray(new ServiceRegistration[]{});
}
Program: 94365
Project: 94365
Buggy source:
private ServiceRegistration[] removeProxyServiceRegistrations(ServiceEndpointDescription sed){
  List results=new ArrayList();
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    if (sed.equals(reg.getServiceEndpointDescription())) {
      i.remove();
      results.addAll(reg.removeAllServiceRegistrations());
      reg.dispose();
    }
  }
  return (ServiceRegistration[])results.toArray(new ServiceRegistration[]{});
}

Fixed version (ground truth):
private ServiceRegistration[] removeProxyServiceRegistrations(RemoteServiceEndpointDescription sed){
  List results=new ArrayList();
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    ServiceRegistration sr=reg.removeServiceRegistration(sed);
    if (reg != null) {
      results.add(sr);
      if (reg.isEmpty()) {
        reg.dispose();
        discoveredRemoteServiceRegistrations.remove(containerID);
      }
    }
  }
  return (ServiceRegistration[])results.toArray(new ServiceRegistration[]{});
}
Program: 94367
Project: 94367
Buggy source:
private boolean findProxyServiceRegistration(RemoteServiceEndpointDescription sed){
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    if (sed.equals(reg.getServiceEndpointDescription()))     return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean findProxyServiceRegistration(RemoteServiceEndpointDescription sed){
  for (Iterator i=discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {
    ID containerID=(ID)i.next();
    RemoteServiceRegistration reg=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(containerID);
    if (reg.hasRSED(sed))     return true;
  }
  return false;
}
Program: 94368
Project: 94368
Buggy source:
public void handleServiceEvent(IRemoteServiceEvent event){
  if (event instanceof IRemoteServiceUnregisteredEvent) {
    trace("String_Node_Str","String_Node_Str" + event.getLocalContainerID() + "String_Node_Str"+ event.getContainerID()+ "String_Node_Str"+ event.getReference());
    ServiceRegistration[] proxyServiceRegistrations=null;
synchronized (serviceLocations) {
      RemoteServiceRegistration rsRegs=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(event.getLocalContainerID());
      if (rsRegs != null) {
        proxyServiceRegistrations=rsRegs.removeServiceRegistration(event.getReference());
        if (rsRegs.isEmpty()) {
          rsRegs.dispose();
          discoveredRemoteServiceRegistrations.remove(event.getContainerID());
        }
      }
    }
    if (proxyServiceRegistrations != null) {
      for (int i=0; i < proxyServiceRegistrations.length; i++) {
        trace("String_Node_Str","String_Node_Str" + event.getLocalContainerID() + "String_Node_Str"+ event.getContainerID()+ "String_Node_Str"+ event.getReference()+ "String_Node_Str"+ proxyServiceRegistrations[i]);
        unregisterProxyServiceRegistration(null,proxyServiceRegistrations[i]);
      }
    }
  }
}

Fixed version (ground truth):
public void handleServiceEvent(IRemoteServiceEvent event){
  if (event instanceof IRemoteServiceUnregisteredEvent) {
    ID containerID=event.getContainerID();
    ID localContainerID=event.getLocalContainerID();
    IRemoteServiceReference reference=event.getReference();
    trace("String_Node_Str","String_Node_Str" + localContainerID + "String_Node_Str"+ containerID+ "String_Node_Str"+ reference);
    RemoteServiceRegistration.RSEDAndSRAssoc[] assocs=null;
synchronized (serviceLocations) {
      RemoteServiceRegistration rsRegs=(RemoteServiceRegistration)discoveredRemoteServiceRegistrations.get(localContainerID);
      if (rsRegs != null) {
        assocs=rsRegs.removeServiceRegistration(reference);
        if (rsRegs.isEmpty()) {
          rsRegs.dispose();
          discoveredRemoteServiceRegistrations.remove(localContainerID);
        }
        if (assocs != null) {
          for (int i=0; i < assocs.length; i++) {
            removeDiscoveredServiceID(assocs[i].getRSED());
          }
        }
      }
    }
    if (assocs != null) {
      for (int i=0; i < assocs.length; i++) {
        ServiceRegistration sr=assocs[i].getSR();
        trace("String_Node_Str","String_Node_Str" + localContainerID + "String_Node_Str"+ containerID+ "String_Node_Str"+ reference+ "String_Node_Str"+ sr);
        unregisterProxyServiceRegistration(assocs[i].getRSED(),sr);
      }
    }
  }
}
Program: 94369
Project: 94369
Buggy source:
public RemoteServiceRegistration(RemoteServiceEndpointDescription sed,IRemoteServiceContainer rsContainer,IRemoteServiceListener l){
  this.serviceEndpointDescription=sed;
  this.rsContainer=rsContainer;
  this.listener=l;
  getContainerAdapter().addRemoteServiceListener(this.listener);
}

Fixed version (ground truth):
public RemoteServiceRegistration(IRemoteServiceContainer rsContainer,IRemoteServiceListener l){
  Assert.isNotNull(rsContainer);
  Assert.isNotNull(l);
  this.rsContainer=rsContainer;
  this.listener=l;
  getContainerAdapter().addRemoteServiceListener(this.listener);
}
Program: 94370
Project: 94370
Buggy source:
public IRemoteServiceContainerAdapter getContainerAdapter(){
  return rsContainer.getContainerAdapter();
}

Fixed version (ground truth):
IRemoteServiceContainerAdapter getContainerAdapter(){
  return rsContainer.getContainerAdapter();
}
Program: 94371
Project: 94371
Buggy source:
public IContainer getContainer(){
  return rsContainer.getContainer();
}

Fixed version (ground truth):
IContainer getContainer(){
  return rsContainer.getContainer();
}
Program: 94372
Project: 94372
Buggy source:
public boolean isEmpty(){
  return serviceRegistrations.size() == 0;
}

Fixed version (ground truth):
boolean isEmpty(){
synchronized (serviceRegistrations) {
    return serviceRegistrations.size() == 0;
  }
}
Program: 94373
Project: 94373
Buggy source:
public void addServiceRegistration(IRemoteServiceReference ref,ServiceRegistration registration){
  List l=(List)serviceRegistrations.get(ref.getID());
  if (l == null) {
    l=new ArrayList();
    serviceRegistrations.put(ref.getID(),l);
  }
  l.add(registration);
}

Fixed version (ground truth):
void addServiceRegistration(IRemoteServiceReference ref,RemoteServiceEndpointDescription rsed,ServiceRegistration registration){
synchronized (serviceRegistrations) {
    List l=(List)serviceRegistrations.get(ref.getID());
    if (l == null) {
      l=new ArrayList();
      serviceRegistrations.put(ref.getID(),l);
    }
    l.add(new RSEDAndSRAssoc(rsed,registration));
  }
}
Program: 94374
Project: 94374
Buggy source:
public void dispose(){
  getContainerAdapter().removeRemoteServiceListener(this.listener);
}

Fixed version (ground truth):
void dispose(){
synchronized (serviceRegistrations) {
    if (listener != null) {
      getContainerAdapter().removeRemoteServiceListener(this.listener);
      this.listener=null;
    }
    if (rsContainer != null) {
      rsContainer=null;
    }
    serviceRegistrations.clear();
  }
}
Program: 94375
Project: 94375
Buggy source:
public ServiceRegistration[] removeServiceRegistration(IRemoteServiceReference reference){
  if (getContainerAdapter().ungetRemoteService(reference)) {
    List l=(List)serviceRegistrations.remove(reference.getID());
    if (l != null)     return (ServiceRegistration[])l.toArray(new ServiceRegistration[]{});
  }
  return null;
}

Fixed version (ground truth):
ServiceRegistration removeServiceRegistration(RemoteServiceEndpointDescription rsed){
  if (rsed == null)   return null;
  ServiceRegistration reg=null;
synchronized (serviceRegistrations) {
    IRemoteServiceID remoteServiceID=null;
    for (Iterator i=serviceRegistrations.keySet().iterator(); i.hasNext(); ) {
      remoteServiceID=(IRemoteServiceID)i.next();
      List assocs=(List)serviceRegistrations.get(remoteServiceID);
      for (Iterator j=assocs.iterator(); j.hasNext(); ) {
        RSEDAndSRAssoc assoc=(RSEDAndSRAssoc)j.next();
        if (rsed.equals(assoc.getRSED())) {
          j.remove();
          reg=assoc.getSR();
        }
      }
    }
    if (reg != null && remoteServiceID != null) {
      serviceRegistrations.remove(remoteServiceID);
    }
  }
  return reg;
}
Program: 94376
Project: 94376
Buggy source:
public boolean processEvent(Event arg0){
  if (arg0 instanceof IContainerConnectedEvent) {
    handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerDisconnectedEvent) {
    handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerEjectedEvent) {
    handleContainerEjectedEvent((IContainerEjectedEvent)arg0);
  }
 else   if (arg0 instanceof ISharedObjectActivatedEvent) {
    if (getSOContext().getConnectedID() != null) {
      addPendingContainers(getGroupMemberIDs());
      sendRegistryUpdateRequest();
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean processEvent(Event arg0){
  if (arg0 instanceof IContainerConnectedEvent) {
    handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerDisconnectedEvent) {
    handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
  }
 else   if (arg0 instanceof IContainerEjectedEvent) {
    handleContainerEjectedEvent((IContainerEjectedEvent)arg0);
  }
 else   if (arg0 instanceof ISharedObjectActivatedEvent) {
    if (getSOContext().getConnectedID() != null) {
      addPendingContainers(getGroupMemberIDs());
      sendRegistryUpdateRequest();
      setRegistryConnected(true);
    }
  }
  return false;
}
Program: 94377
Project: 94377
Buggy source:
/** 
 * @since 3.3 for preventing issues like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304427
 */
protected void connectToRemoteServiceTarget(ID targetID) throws ContainerConnectException {
synchronized (rsConnectLock) {
    ISharedObjectContext context=getContext();
    if (context == null)     throw new ContainerConnectException("String_Node_Str");
    ID connectedID=context.getConnectedID();
    if (connectedID != null) {
      if (connectedID.equals(targetID))       return;
      throw new ContainerConnectException("String_Node_Str" + connectedID);
    }
    context.connect(targetID,connectContext);
    waitForConnectEvent(context,targetID);
  }
}

Fixed version (ground truth):
/** 
 * @since 3.3 for preventing issues like bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=304427
 */
protected void connectToRemoteServiceTarget(ID targetID) throws ContainerConnectException {
synchronized (rsConnectLock) {
    ISharedObjectContext context=getContext();
    if (context == null)     throw new ContainerConnectException("String_Node_Str");
    ID connectedID=context.getConnectedID();
    if (connectedID != null) {
      if (connectedID.equals(targetID))       return;
      throw new ContainerConnectException("String_Node_Str" + connectedID);
    }
    context.connect(targetID,connectContext);
    waitForConnectedEvent(context,targetID);
  }
}
Program: 94378
Project: 94378
Buggy source:
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter,String clazz,String filter) throws InvalidSyntaxException {
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",new Object[]{idFilter,clazz,filter});
  if (clazz == null)   return null;
  final IRemoteFilter remoteFilter=(filter == null) ? null : new RemoteFilterImpl(filter);
  waitForPendingUpdates(idFilter,addRegistrationRequestTimeout);
  final List references=new ArrayList();
  addReferencesFromRemoteRegistrys(idFilter,clazz,remoteFilter,references);
  ID localContainerID=getLocalContainerID();
  if (idFilter == null || Arrays.asList(idFilter).contains(localContainerID)) {
synchronized (localRegistry) {
      addReferencesFromRegistry(clazz,remoteFilter,localRegistry,references);
    }
  }
  final IRemoteServiceReference[] result=(IRemoteServiceReference[])references.toArray(new IRemoteServiceReference[references.size()]);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str",result);
  return (result.length == 0) ? null : result;
}

Fixed version (ground truth):
public IRemoteServiceReference[] getRemoteServiceReferences(ID[] idFilter,String clazz,String filter) throws InvalidSyntaxException {
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",new Object[]{idFilter,clazz,filter});
  if (clazz == null)   return null;
  final IRemoteFilter remoteFilter=(filter == null) ? null : new RemoteFilterImpl(filter);
  waitForPendingUpdates(idFilter,getAddRegistrationRequestTimeout());
  final List references=new ArrayList();
  addReferencesFromRemoteRegistrys(idFilter,clazz,remoteFilter,references);
  ID localContainerID=getLocalContainerID();
  if (idFilter == null || Arrays.asList(idFilter).contains(localContainerID)) {
synchronized (localRegistry) {
      addReferencesFromRegistry(clazz,remoteFilter,localRegistry,references);
    }
  }
  final IRemoteServiceReference[] result=(IRemoteServiceReference[])references.toArray(new IRemoteServiceReference[references.size()]);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str",result);
  return (result.length == 0) ? null : result;
}
Program: 94379
Project: 94379
Buggy source:
private void handleTargetGoneEvent(ID targetID){
  RemoteServiceRegistrationImpl registrations[]=null;
synchronized (remoteRegistrys) {
    final RemoteServiceRegistryImpl registry=getRemoteRegistry(targetID);
    if (registry != null) {
      removeRemoteRegistry(targetID);
      registrations=registry.getRegistrations();
      if (registrations != null) {
        for (int i=0; i < registrations.length; i++) {
          registry.unpublishService(registrations[i]);
          unregisterServiceRegistrationsForContainer(registrations[i].getContainerID());
        }
      }
    }
  }
  if (registrations != null) {
    for (int i=0; i < registrations.length; i++) {
      fireRemoteServiceListeners(createUnregisteredEvent(registrations[i]));
    }
  }
  removePendingContainers(targetID);
synchronized (rsConnectLock) {
    rsConnected=false;
    rsConnectLock.notify();
  }
}

Fixed version (ground truth):
private void handleTargetGoneEvent(ID targetID){
  RemoteServiceRegistrationImpl registrations[]=null;
synchronized (remoteRegistrys) {
    final RemoteServiceRegistryImpl registry=getRemoteRegistry(targetID);
    if (registry != null) {
      removeRemoteRegistry(targetID);
      registrations=registry.getRegistrations();
      if (registrations != null) {
        for (int i=0; i < registrations.length; i++) {
          registry.unpublishService(registrations[i]);
          unregisterServiceRegistrationsForContainer(registrations[i].getContainerID());
        }
      }
    }
  }
  if (registrations != null) {
    for (int i=0; i < registrations.length; i++) {
      fireRemoteServiceListeners(createUnregisteredEvent(registrations[i]));
    }
  }
  removePendingContainers(targetID);
  if (getConnectedID() == null)   setRegistryConnected(false);
}
Program: 94380
Project: 94380
Buggy source:
/** 
 * @since 3.0
 */
public IRemoteServiceReference getRemoteServiceReference(IRemoteServiceID serviceId){
  ID containerID=serviceId.getContainerID();
  RemoteServiceRegistrationImpl registration=null;
  waitForPendingUpdates(new ID[]{serviceId.getContainerID()},addRegistrationRequestTimeout);
  if (this.localRegistry.containerID.equals(containerID)) {
synchronized (localRegistry) {
      registration=localRegistry.findRegistrationForServiceId(serviceId.getContainerRelativeID());
      if (registration != null)       return registration.getReference();
    }
  }
 else {
synchronized (remoteRegistrys) {
      final ArrayList registrys=new ArrayList(remoteRegistrys.values());
      for (final Iterator i=registrys.iterator(); i.hasNext(); ) {
        final RemoteServiceRegistryImpl registry=(RemoteServiceRegistryImpl)i.next();
        registration=registry.findRegistrationForServiceId(serviceId.getContainerRelativeID());
      }
    }
  }
  return (registration == null) ? null : registration.getReference();
}

Fixed version (ground truth):
/** 
 * @since 3.0
 */
public IRemoteServiceReference getRemoteServiceReference(IRemoteServiceID serviceId){
  ID containerID=serviceId.getContainerID();
  RemoteServiceRegistrationImpl registration=null;
  waitForPendingUpdates(new ID[]{serviceId.getContainerID()},getAddRegistrationRequestTimeout());
  if (this.localRegistry.containerID.equals(containerID)) {
synchronized (localRegistry) {
      registration=localRegistry.findRegistrationForServiceId(serviceId.getContainerRelativeID());
      if (registration != null)       return registration.getReference();
    }
  }
 else {
synchronized (remoteRegistrys) {
      final ArrayList registrys=new ArrayList(remoteRegistrys.values());
      for (final Iterator i=registrys.iterator(); i.hasNext(); ) {
        final RemoteServiceRegistryImpl registry=(RemoteServiceRegistryImpl)i.next();
        registration=registry.findRegistrationForServiceId(serviceId.getContainerRelativeID());
      }
    }
  }
  return (registration == null) ? null : registration.getReference();
}
Program: 94381
Project: 94381
Buggy source:
protected void handleContainerConnectedEvent(IContainerConnectedEvent event){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",event);
  ID targetID=event.getTargetID();
  addPendingContainers(new ID[]{targetID});
  sendRegistryUpdate(targetID);
synchronized (rsConnectLock) {
    rsConnected=true;
    rsConnectLock.notify();
  }
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}

Fixed version (ground truth):
protected void handleContainerConnectedEvent(IContainerConnectedEvent event){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",event);
  ID targetID=event.getTargetID();
  addPendingContainers(new ID[]{targetID});
  sendRegistryUpdate(targetID);
  ID connectedID=getConnectedID();
  if (connectedID != null && connectedID.equals(targetID))   setRegistryConnected(true);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}
Program: 94382
Project: 94382
Buggy source:
public void initialize() throws SharedObjectInitException {
  super.initialize();
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  localRegistry=new RemoteServiceRegistryImpl(getLocalContainerID());
  super.addEventProcessor(new IEventProcessor(){
    public boolean processEvent(    Event arg0){
      if (arg0 instanceof IContainerConnectedEvent) {
        handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerDisconnectedEvent) {
        handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerEjectedEvent) {
        handleContainerEjectedEvent((IContainerEjectedEvent)arg0);
      }
 else       if (arg0 instanceof ISharedObjectActivatedEvent) {
        if (getSOContext().getConnectedID() != null) {
          addPendingContainers(getGroupMemberIDs());
          sendRegistryUpdateRequest();
        }
      }
      return false;
    }
  }
);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}

Fixed version (ground truth):
public void initialize() throws SharedObjectInitException {
  super.initialize();
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str");
  localRegistry=new RemoteServiceRegistryImpl(getLocalContainerID());
  super.addEventProcessor(new IEventProcessor(){
    public boolean processEvent(    Event arg0){
      if (arg0 instanceof IContainerConnectedEvent) {
        handleContainerConnectedEvent((IContainerConnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerDisconnectedEvent) {
        handleContainerDisconnectedEvent((IContainerDisconnectedEvent)arg0);
      }
 else       if (arg0 instanceof IContainerEjectedEvent) {
        handleContainerEjectedEvent((IContainerEjectedEvent)arg0);
      }
 else       if (arg0 instanceof ISharedObjectActivatedEvent) {
        if (getSOContext().getConnectedID() != null) {
          addPendingContainers(getGroupMemberIDs());
          sendRegistryUpdateRequest();
          setRegistryConnected(true);
        }
      }
      return false;
    }
  }
);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}
Program: 94383
Project: 94383
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getSocksProxy(directoryOrFile);
    if (proxy == null) {
      proxy=ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      proxy=ProxySetupHelper.getSocksProxy(directoryOrFile);
      if (proxy == null) {
        proxy=ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
      }
    }
 catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94384
Project: 94384
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getSocksProxy(getRemoteFileURL());
    if (proxy == null) {
      proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    try {
      proxy=ProxySetupHelper.getSocksProxy(getRemoteFileURL());
      if (proxy == null) {
        proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
      }
    }
 catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}