nus-yam/ex-repair huggingface dataset:
Program: 94146
Project: 94146
Buggy source:
protected boolean namespaceEquals(BaseID o){
  if (!(o instanceof XMPPID)) {
    return false;
  }
  final XMPPID other=(XMPPID)o;
  String thisResourceName=getResourceName();
  String otherResourceName=other.getResourceName();
  boolean resourceEquals=false;
  if (thisResourceName == null)   resourceEquals=(otherResourceName == null) ? true : false;
 else   resourceEquals=thisResourceName.equals(otherResourceName);
  return resourceEquals && getUsernameAtHost().equals(other.getUsernameAtHost());
}

Fixed version (ground truth):
protected boolean namespaceEquals(BaseID o){
  if (!(o instanceof XMPPID)) {
    return false;
  }
  final XMPPID other=(XMPPID)o;
  String thisResourceName=getResourceName();
  String otherResourceName=other.getResourceName();
  boolean resourceEquals=false;
  if (thisResourceName == null)   resourceEquals=(otherResourceName == null) ? true : false;
 else   if (otherResourceName == null)   resourceEquals=(thisResourceName == null) ? true : false;
 else   resourceEquals=thisResourceName.equals(otherResourceName) || thisResourceName.endsWith(otherResourceName) || otherResourceName.endsWith(thisResourceName);
  return resourceEquals && getUsernameAtHost().equals(other.getUsernameAtHost());
}
Program: 94147
Project: 94147
Buggy source:
void removeEndpoint(EndpointDescription ed){
  contentProvider.getRootNode().removeChild(new EndpointNode(ed));
}

Fixed version (ground truth):
void removeEndpoint(EndpointDescription ed){
  if (discoveredEndpointIds.remove(ed.getId()))   contentProvider.getRootNode().removeChild(new EndpointNode(ed));
}
Program: 94148
Project: 94148
Buggy source:
void addEndpoint(EndpointDescription ed){
  if (EndpointDiscoveryView.this.previousRegistryBrowserGroupBy != RegistryBrowser.SERVICES)   showServicesInRegistryBrowser();
  contentProvider.getRootNode().addChild(createEndpointDescriptionNode(ed));
}

Fixed version (ground truth):
void addEndpoint(EndpointDescription ed){
  if (EndpointDiscoveryView.this.previousRegistryBrowserGroupBy != RegistryBrowser.SERVICES)   showServicesInRegistryBrowser();
  String edId=ed.getId();
  if (!discoveredEndpointIds.contains(edId)) {
    discoveredEndpointIds.add(edId);
    contentProvider.getRootNode().addChild(createEndpointDescriptionNode(ed));
  }
}
Program: 94149
Project: 94149
Buggy source:
@Override public void dispose(){
  showInRegistryBrowser(previousRegistryBrowserGroupBy);
  super.dispose();
  viewer=null;
  contentProvider=null;
  if (discovery != null) {
    discovery.setView(null);
    discovery=null;
  }
}

Fixed version (ground truth):
@Override public void dispose(){
  showInRegistryBrowser(previousRegistryBrowserGroupBy);
  super.dispose();
  viewer=null;
  contentProvider=null;
  if (discovery != null) {
    discovery.setView(null);
    discovery=null;
  }
  discoveredEndpointIds.clear();
}
Program: 94150
Project: 94150
Buggy source:
public synchronized void selectTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID userID){
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
public synchronized void selectTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID userID){
  selectTab(messageSender,typingSender,localID,userID,getLocalName(userID));
}
Program: 94151
Project: 94151
Buggy source:
/** 
 * @since 2.3
 */
public synchronized void openTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID remoteID){
  throw new RuntimeException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @since 2.3
 */
public synchronized void openTab(IChatMessageSender messageSender,ITypingMessageSender typingSender,ID localID,ID remoteID){
  openTab(messageSender,typingSender,localID,remoteID,getLocalName(remoteID));
}
Program: 94152
Project: 94152
Buggy source:
private SSLServerSocketFactory getServerSocketFactory(){
  return ProviderPlugin.getDefault().getSSLServerSocketFactory();
}

Fixed version (ground truth):
/** 
 * @since 4.6
 */
private SSLServerSocketFactory getServerSocketFactory(){
  return ProviderPlugin.getDefault().getSSLServerSocketFactory();
}
Program: 94154
Project: 94154
Buggy source:
/** 
 * @since 4.5
 */
protected IContainer createServerContainer(GenericContainerArgs gcargs) throws Exception {
  return new SSLServerSOContainer(new SOContainerConfig(gcargs.getID()),gcargs.getBindAddress(),gcargs.getKeepAlive().intValue());
}

Fixed version (ground truth):
/** 
 * @since 4.5
 */
protected IContainer createServerContainer(GenericContainerArgs gcargs) throws Exception {
  SOContainerConfig config=new SOContainerConfig(gcargs.getID());
  ID id=gcargs.getID();
  URI uri=URI.create(id.getName());
  SSLServerSocket serverSocket=createSSLServerSocket(uri.getPort(),gcargs.getBindAddress());
  if (gcargs.getClientAuth()) {
    if (gcargs.getNeedClientAuth())     serverSocket.setNeedClientAuth(true);
 else     if (gcargs.getWantClientAuth())     serverSocket.setWantClientAuth(true);
  }
  return new SSLServerSOContainer(config,serverSocket,gcargs.getKeepAlive().intValue());
}
Program: 94155
Project: 94155
Buggy source:
public GenericContainerArgs(ID id,Integer keepAlive,InetAddress bindAddress){
  this.id=id;
  this.keepAlive=keepAlive;
  this.bindAddress=bindAddress;
}

Fixed version (ground truth):
public GenericContainerArgs(ID id,Integer keepAlive,InetAddress bindAddress,boolean wantClientAuth,boolean needClientAuth){
  this.id=id;
  this.keepAlive=keepAlive;
  this.bindAddress=bindAddress;
  this.wantClientAuth=wantClientAuth;
  this.needClientAuth=needClientAuth;
}
Program: 94156
Project: 94156
Buggy source:
/** 
 * @since 4.6
 */
public SSLServerSOContainerGroup(String name,ThreadGroup group,SSLServerSocket sslServerSocket){
  super(name);
  this.threadGroup=group;
  this.serverSocket=sslServerSocket;
}

Fixed version (ground truth):
/** 
 * @since 4.6
 */
public SSLServerSOContainerGroup(String name,ThreadGroup group,SSLServerSocket sslServerSocket){
  super(name);
  this.threadGroup=group;
  this.serverSocket=sslServerSocket;
  this.port=serverSocket.getLocalPort();
  this.listenerThread=setupListener();
}
Program: 94157
Project: 94157
Buggy source:
private static synchronized Integer createNextRequestId(){
  uniqueRequestId=(uniqueRequestId == Integer.MAX_VALUE) ? 0 : uniqueRequestId + 1;
  return new Integer(uniqueRequestId++);
}

Fixed version (ground truth):
private static synchronized Integer createNextRequestId(){
  uniqueRequestId=(uniqueRequestId == Integer.MAX_VALUE) ? 0 : uniqueRequestId + 1;
  return new Integer(uniqueRequestId);
}
Program: 94158
Project: 94158
Buggy source:
protected void runWithoutRegistry() throws Exception {
  IAdapterManager am=getAdapterManager();
  if (am != null) {
    IAdapterFactory af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
    rscAdapterFactories.add(af);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
    rscAdapterFactories.add(af);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
    rscAdapterFactories.add(af);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
    rscAdapterFactories.add(af);
  }
}

Fixed version (ground truth):
protected void runWithoutRegistry() throws Exception {
  IAdapterManager am=getAdapterManager();
  if (am != null) {
    IAdapterFactory af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
    af=new DatashareContainerAdapterFactory();
    am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
  }
}
Program: 94159
Project: 94159
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(final BundleContext ctxt) throws Exception {
  this.context=ctxt;
  SafeRunner.run(new ExtensionRegistryRunnable(ctxt){
    protected void runWithoutRegistry() throws Exception {
      IAdapterManager am=getAdapterManager();
      if (am != null) {
        IAdapterFactory af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
        rscAdapterFactories.add(af);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
        rscAdapterFactories.add(af);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
        rscAdapterFactories.add(af);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
        rscAdapterFactories.add(af);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 */
public void start(final BundleContext ctxt) throws Exception {
  this.context=ctxt;
  SafeRunner.run(new ExtensionRegistryRunnable(ctxt){
    protected void runWithoutRegistry() throws Exception {
      IAdapterManager am=getAdapterManager();
      if (am != null) {
        IAdapterFactory af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLServerSOContainer.class);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPServerSOContainer.class);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.SSLClientSOContainer.class);
        af=new DatashareContainerAdapterFactory();
        am.registerAdapters(af,org.eclipse.ecf.provider.generic.TCPClientSOContainer.class);
      }
    }
  }
);
}
Program: 94161
Project: 94161
Buggy source:
public synchronized void close(){
  if (locator != null) {
    locator.removeServiceListener(this);
    locator=null;
  }
  edServiceIDMap.clear();
}

Fixed version (ground truth):
public synchronized void close(){
  if (locator != null) {
    locator.removeServiceListener(this);
    locator=null;
  }
}
Program: 94164
Project: 94164
Buggy source:
private void setNodeProperties(){
  this.nodeProperties.put(NODE_PROPERTY_SERVICE_NAME,getServiceName());
  this.nodeProperties.put(NODE_SERVICE_PROPERTIES,super.properties);
  this.nodeProperties.put(NODE_PROPERTY_NAME_PROTOCOLS,getServiceID().getServiceTypeID().getProtocols());
  this.nodeProperties.put(NODE_PROPERTY_NAME_SCOPE,getServiceID().getServiceTypeID().getScopes());
  this.nodeProperties.put(NODE_PROPERTY_SERVICES,getServiceID().getServiceTypeID().getServices());
  this.nodeProperties.put(NODE_PROPERTY_NAME_NA,getServiceID().getServiceTypeID().getNamingAuthority());
  this.nodeProperties.put(LOCATION,getLocation());
  this.nodeProperties.put(WEIGHT,getWeight());
  this.nodeProperties.put(PRIORITY,getPriority());
  publishedServices.put(getServiceID().getServiceTypeID().getInternal(),this);
}

Fixed version (ground truth):
private void setNodeProperties(){
  this.nodeProperties.put(NODE_PROPERTY_SERVICE_NAME,getServiceName());
  this.nodeProperties.put(NODE_SERVICE_PROPERTIES,super.properties);
  this.nodeProperties.put(NODE_PROPERTY_NAME_PROTOCOLS,getServiceID().getServiceTypeID().getProtocols());
  this.nodeProperties.put(NODE_PROPERTY_NAME_SCOPE,getServiceID().getServiceTypeID().getScopes());
  this.nodeProperties.put(NODE_PROPERTY_SERVICES,getServiceID().getServiceTypeID().getServices());
  this.nodeProperties.put(NODE_PROPERTY_NAME_NA,getServiceID().getServiceTypeID().getNamingAuthority());
  this.nodeProperties.put(LOCATION,getLocation());
  this.nodeProperties.put(WEIGHT,getWeight());
  this.nodeProperties.put(PRIORITY,getPriority());
  publishedServices.put(getServiceID().getName(),this);
}
Program: 94165
Project: 94165
Buggy source:
public void unregisterService(IServiceInfo serviceInfo){
  Assert.isNotNull(serviceInfo);
  watchManager.unpublish(serviceInfo.getServiceID().getServiceTypeID().getInternal());
  Localizer.getSingleton().localize(new Notification(serviceInfo,Notification.UNAVAILABLE));
}

Fixed version (ground truth):
public void unregisterService(IServiceInfo serviceInfo){
  Assert.isNotNull(serviceInfo);
  watchManager.unpublish(serviceInfo.getServiceID().getName());
  Localizer.getSingleton().localize(new Notification(serviceInfo,Notification.UNAVAILABLE));
}
Program: 94166
Project: 94166
Buggy source:
public void publish(AdvertisedService published){
  Assert.isNotNull(published);
  String serviceid=published.getServiceID().getServiceTypeID().getInternal();
  if (getNodeWriters().containsKey(serviceid))   return;
  try {
    while (!writeRootLock.isOpen())     Thread.sleep(300);
  }
 catch (  InterruptedException e) {
    Logger.log(LogService.LOG_DEBUG,e.getMessage(),e);
  }
  NodeWriter nodeWriter=new NodeWriter(published,writeRoot);
  getNodeWriters().put(serviceid,nodeWriter);
  allKnownServices.put(published.getServiceID().getName(),published);
  nodeWriter.publish();
}

Fixed version (ground truth):
public void publish(AdvertisedService published){
  Assert.isNotNull(published);
  try {
    while (!writeRootLock.isOpen())     Thread.sleep(300);
  }
 catch (  InterruptedException e) {
    Logger.log(LogService.LOG_DEBUG,e.getMessage(),e);
  }
  String serviceName=published.getServiceID().getName();
  NodeWriter nodeWriter=new NodeWriter(published,writeRoot);
  getNodeWriters().put(serviceName,nodeWriter);
  allKnownServices.put(serviceName,published);
  nodeWriter.publish();
}
Program: 94167
Project: 94167
Buggy source:
void handleRemoteAdminEvent(RemoteServiceAdminEvent event){
  if (!(event instanceof RemoteServiceAdmin.RemoteServiceAdminEvent))   return;
  RemoteServiceAdmin.RemoteServiceAdminEvent rsaEvent=(RemoteServiceAdmin.RemoteServiceAdminEvent)event;
  int eventType=event.getType();
  EndpointDescription endpointDescription=rsaEvent.getEndpointDescription();
switch (eventType) {
case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
    advertiseEndpointDescription(endpointDescription);
  break;
case RemoteServiceAdminEvent.EXPORT_UNREGISTRATION:
unadvertiseEndpointDescription(endpointDescription);
break;
case RemoteServiceAdminEvent.EXPORT_ERROR:
logError("String_Node_Str","String_Node_Str" + rsaEvent);
break;
case RemoteServiceAdminEvent.IMPORT_REGISTRATION:
break;
case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
break;
case RemoteServiceAdminEvent.IMPORT_ERROR:
break;
default :
logWarning("String_Node_Str","String_Node_Str" + rsaEvent + "String_Node_Str");
}
}

Fixed version (ground truth):
void handleRemoteAdminEvent(RemoteServiceAdminEvent event){
  if (!(event instanceof RemoteServiceAdmin.RemoteServiceAdminEvent))   return;
  RemoteServiceAdmin.RemoteServiceAdminEvent rsaEvent=(RemoteServiceAdmin.RemoteServiceAdminEvent)event;
  int eventType=event.getType();
  EndpointDescription endpointDescription=rsaEvent.getEndpointDescription();
switch (eventType) {
case RemoteServiceAdminEvent.EXPORT_REGISTRATION:
    advertiseEndpointDescription(endpointDescription);
  break;
case RemoteServiceAdminEvent.EXPORT_UNREGISTRATION:
unadvertiseEndpointDescription(endpointDescription);
break;
case RemoteServiceAdminEvent.EXPORT_ERROR:
logError("String_Node_Str","String_Node_Str" + rsaEvent);
break;
case RemoteServiceAdminEvent.EXPORT_WARNING:
logWarning("String_Node_Str","String_Node_Str" + rsaEvent);
break;
case RemoteServiceAdminEvent.EXPORT_UPDATE:
advertiseModifyEndpointDescription(endpointDescription);
break;
case RemoteServiceAdminEvent.IMPORT_REGISTRATION:
break;
case RemoteServiceAdminEvent.IMPORT_UNREGISTRATION:
break;
case RemoteServiceAdminEvent.IMPORT_ERROR:
logError("String_Node_Str","String_Node_Str" + rsaEvent);
break;
case RemoteServiceAdminEvent.IMPORT_WARNING:
logWarning("String_Node_Str","String_Node_Str" + rsaEvent);
break;
default :
logWarning("String_Node_Str","String_Node_Str" + rsaEvent + "String_Node_Str");
}
}
Program: 94168
Project: 94168
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);
      advertiseModifyEndpointDescription((EndpointDescription)exportedRegistration.update(PropertiesUtil.copyProperties(serviceReference,new HashMap<String,Object>())));
    }
  }
}

Fixed version (ground truth):
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());
    }
  }
}
Program: 94171
Project: 94171
Buggy source:
ExportEndpoint(ServiceReference serviceReference,EndpointDescription endpointDescription,IRemoteServiceRegistration reg){
  Assert.isNotNull(serviceReference);
  this.serviceReference=serviceReference;
  Assert.isNotNull(endpointDescription);
  this.endpointDescription=endpointDescription;
  Assert.isNotNull(reg);
  this.rsRegistration=reg;
}

Fixed version (ground truth):
ExportEndpoint(ServiceReference serviceReference,EndpointDescription endpointDescription,IRemoteServiceRegistration reg,Map<String,Object> originalProperties){
  Assert.isNotNull(serviceReference);
  this.serviceReference=serviceReference;
  Assert.isNotNull(endpointDescription);
  this.endpointDescription=endpointDescription;
  Assert.isNotNull(reg);
  this.rsRegistration=reg;
  Assert.isNotNull(originalProperties);
  this.originalProperties=originalProperties;
}
Program: 94173
Project: 94173
Buggy source:
public void stop(BundleContext ctxt) throws Exception {
  if (eventListenerHookRegistration != null) {
    eventListenerHookRegistration.unregister();
    eventListenerHookRegistration=null;
  }
  if (basicTopologyManagerComp != null) {
    basicTopologyManagerComp.unbindEndpointEventListener(basicTopologyManagerImpl);
    basicTopologyManagerComp=null;
  }
  if (endpointEventListenerReg != null) {
    endpointEventListenerReg.unregister();
    endpointEventListenerReg=null;
  }
  if (endpointListenerReg != null) {
    endpointListenerReg.unregister();
    endpointEventListenerReg=null;
  }
  if (eventAdminListenerRegistration != null) {
    eventAdminListenerRegistration.unregister();
    eventAdminListenerRegistration=null;
  }
synchronized (bundleEndpointEventListenerMap) {
    bundleEndpointEventListenerMap.clear();
  }
  if (basicTopologyManagerImpl != null) {
    basicTopologyManagerImpl.close();
    basicTopologyManagerImpl=null;
  }
  if (logServiceTracker != null) {
    logServiceTracker.close();
    logServiceTracker=null;
    logService=null;
  }
  this.context=null;
  plugin=null;
}

Fixed version (ground truth):
public void stop(BundleContext ctxt) throws Exception {
  if (eventListenerHookRegistration != null) {
    eventListenerHookRegistration.unregister();
    eventListenerHookRegistration=null;
  }
  if (basicTopologyManagerComp != null) {
    basicTopologyManagerComp.unbindEndpointEventListener(basicTopologyManagerImpl);
    basicTopologyManagerComp=null;
  }
  if (endpointEventListenerReg != null) {
    endpointEventListenerReg.unregister();
    endpointEventListenerReg=null;
  }
  if (endpointListenerReg != null) {
    endpointListenerReg.unregister();
    endpointListenerReg=null;
  }
  if (eventAdminListenerRegistration != null) {
    eventAdminListenerRegistration.unregister();
    eventAdminListenerRegistration=null;
  }
synchronized (bundleEndpointEventListenerMap) {
    bundleEndpointEventListenerMap.clear();
  }
  if (basicTopologyManagerImpl != null) {
    basicTopologyManagerImpl.close();
    basicTopologyManagerImpl=null;
  }
  if (logServiceTracker != null) {
    logServiceTracker.close();
    logServiceTracker=null;
    logService=null;
  }
  this.context=null;
  plugin=null;
}
Program: 94175
Project: 94175
Buggy source:
public Object getService(Bundle bundle,ServiceRegistration registration){
  RemoteServiceAdmin result=null;
synchronized (remoteServiceAdmins) {
    RemoteServiceAdmin rsa=remoteServiceAdmins.get(bundle);
    if (rsa == null) {
      rsa=new RemoteServiceAdmin(bundle);
      remoteServiceAdmins.put(bundle,rsa);
    }
    result=rsa;
  }
  return result;
}

Fixed version (ground truth):
public Object getService(Bundle bundle,ServiceRegistration registration){
  RemoteServiceAdmin result=null;
synchronized (remoteServiceAdmins) {
    RemoteServiceAdmin rsa=remoteServiceAdmins.get(bundle);
    if (rsa == null) {
      rsa=new RemoteServiceAdmin(bundle,exportedRegistrations,importedRegistrations);
      remoteServiceAdmins.put(bundle,rsa);
    }
    result=rsa;
  }
  return result;
}
Program: 94176
Project: 94176
Buggy source:
public void stop(BundleContext bundleContext) throws Exception {
  if (endpointDescriptionLocator != null) {
    endpointDescriptionLocator.close();
    endpointDescriptionLocator=null;
  }
  if (ctdTracker != null) {
    ctdTracker.close();
    ctdTracker=null;
  }
  if (remoteServiceAdminRegistration != null) {
    remoteServiceAdminRegistration.unregister();
    remoteServiceAdminRegistration=null;
  }
  clearRSAs();
  if (iServiceInfoFactoryRegistration != null) {
    iServiceInfoFactoryRegistration.unregister();
    iServiceInfoFactoryRegistration=null;
  }
synchronized (saxParserFactoryTrackerLock) {
    if (saxParserFactoryTracker != null) {
      saxParserFactoryTracker.close();
      saxParserFactoryTracker=null;
    }
  }
synchronized (logServiceTrackerLock) {
    if (logServiceTracker != null) {
      logServiceTracker.close();
      logServiceTracker=null;
      logService=null;
    }
  }
  stopProxyServiceFactoryBundle();
  Activator.context=null;
  Activator.instance=null;
}

Fixed version (ground truth):
public void stop(BundleContext bundleContext) throws Exception {
  if (endpointDescriptionLocator != null) {
    endpointDescriptionLocator.close();
    endpointDescriptionLocator=null;
  }
  if (ctdTracker != null) {
    ctdTracker.close();
    ctdTracker=null;
  }
  if (remoteServiceAdminRegistration != null) {
    remoteServiceAdminRegistration.unregister();
    remoteServiceAdminRegistration=null;
  }
  if (iServiceInfoFactoryRegistration != null) {
    iServiceInfoFactoryRegistration.unregister();
    iServiceInfoFactoryRegistration=null;
  }
synchronized (saxParserFactoryTrackerLock) {
    if (saxParserFactoryTracker != null) {
      saxParserFactoryTracker.close();
      saxParserFactoryTracker=null;
    }
  }
synchronized (logServiceTrackerLock) {
    if (logServiceTracker != null) {
      logServiceTracker.close();
      logServiceTracker=null;
      logService=null;
    }
  }
  stopProxyServiceFactoryBundle();
synchronized (importedRegistrations) {
    if (importedRegistrations != null) {
      importedRegistrations.clear();
      importedRegistrations=null;
    }
  }
synchronized (exportedRegistrations) {
    if (exportedRegistrations != null) {
      exportedRegistrations.clear();
      exportedRegistrations=null;
    }
  }
  Activator.context=null;
  Activator.instance=null;
}
Program: 94177
Project: 94177
Buggy source:
private ImportEndpoint findImportEndpoint(EndpointDescription ed){
  for (  ImportRegistration reg : importedRegistrations) {
    ImportEndpoint endpoint=reg.getImportEndpoint(ed);
    if (endpoint != null)     return endpoint;
  }
  return null;
}

Fixed version (ground truth):
private ImportEndpoint findImportEndpoint(EndpointDescription ed){
  for (  org.osgi.service.remoteserviceadmin.ImportRegistration reg : importedRegistrations) {
    if (reg instanceof ImportRegistration) {
      ImportEndpoint endpoint=((ImportRegistration)reg).getImportEndpoint(ed);
      if (endpoint != null)       return endpoint;
    }
  }
  return null;
}
Program: 94178
Project: 94178
Buggy source:
private boolean removeImportRegistration(ImportRegistration importRegistration){
synchronized (importedRegistrations) {
    return importedRegistrations.remove(importRegistration);
  }
}

Fixed version (ground truth):
private boolean removeImportRegistration(ImportRegistration importRegistration){
synchronized (importedRegistrations) {
    localExportedRegistrations.remove(importRegistration);
    return importedRegistrations.remove(importRegistration);
  }
}
Program: 94179
Project: 94179
Buggy source:
private Bundle getRSABundle(){
  return getRSABundleContext().getBundle();
}

Fixed version (ground truth):
private Bundle getRSABundle(){
  BundleContext bc=Activator.getContext();
  if (bc == null)   return null;
  return bc.getBundle();
}
Program: 94180
Project: 94180
Buggy source:
private void unimportService(IRemoteServiceID remoteServiceID){
  List<ImportRegistration> removedRegistrations=new ArrayList<ImportRegistration>();
synchronized (importedRegistrations) {
    for (Iterator<ImportRegistration> i=importedRegistrations.iterator(); i.hasNext(); ) {
      ImportRegistration importRegistration=i.next();
      if (importRegistration != null && importRegistration.match(remoteServiceID))       removedRegistrations.add(importRegistration);
    }
  }
  for (  ImportRegistration removedReg : removedRegistrations) {
    trace("String_Node_Str","String_Node_Str" + removedReg);
    removedReg.close();
  }
}

Fixed version (ground truth):
private void unimportService(IRemoteServiceID remoteServiceID){
  List<ImportRegistration> removedRegistrations=new ArrayList<ImportRegistration>();
synchronized (importedRegistrations) {
    for (Iterator<org.osgi.service.remoteserviceadmin.ImportRegistration> i=importedRegistrations.iterator(); i.hasNext(); ) {
      org.osgi.service.remoteserviceadmin.ImportRegistration iReg=i.next();
      if (iReg instanceof ImportRegistration) {
        ImportRegistration importRegistration=(ImportRegistration)iReg;
        if (importRegistration.match(remoteServiceID))         removedRegistrations.add(importRegistration);
      }
    }
  }
  for (  ImportRegistration removedReg : removedRegistrations) {
    trace("String_Node_Str","String_Node_Str" + removedReg);
    removedReg.close();
  }
}
Program: 94181
Project: 94181
Buggy source:
private boolean removeExportRegistration(ExportRegistration exportRegistration){
synchronized (exportedRegistrations) {
    return exportedRegistrations.remove(exportRegistration);
  }
}

Fixed version (ground truth):
private boolean removeExportRegistration(ExportRegistration exportRegistration){
synchronized (exportedRegistrations) {
    localExportedRegistrations.remove(exportRegistration);
    return exportedRegistrations.remove(exportRegistration);
  }
}
Program: 94182
Project: 94182
Buggy source:
protected IConsumerContainerSelector getConsumerContainerSelector(){
  return AccessController.doPrivileged(new PrivilegedAction<IConsumerContainerSelector>(){
    public IConsumerContainerSelector run(){
synchronized (consumerContainerSelectorTrackerLock) {
        if (consumerContainerSelectorTracker == null) {
          consumerContainerSelectorTracker=new ServiceTracker(getClientBundleContext(),IConsumerContainerSelector.class.getName(),null);
          consumerContainerSelectorTracker.open();
        }
      }
      return (IConsumerContainerSelector)consumerContainerSelectorTracker.getService();
    }
  }
);
}

Fixed version (ground truth):
protected IConsumerContainerSelector getConsumerContainerSelector(){
  return AccessController.doPrivileged(new PrivilegedAction<IConsumerContainerSelector>(){
    public IConsumerContainerSelector run(){
synchronized (consumerContainerSelectorTrackerLock) {
        if (consumerContainerSelectorTracker == null) {
          consumerContainerSelectorTracker=new ServiceTracker(getRSABundleContext(),IConsumerContainerSelector.class.getName(),null);
          consumerContainerSelectorTracker.open();
        }
      }
      return (IConsumerContainerSelector)consumerContainerSelectorTracker.getService();
    }
  }
);
}
Program: 94183
Project: 94183
Buggy source:
private ExportEndpoint findExistingExportEndpoint(ServiceReference serviceReference,ID containerID){
  for (  ExportRegistration eReg : exportedRegistrations) {
    ExportEndpoint exportEndpoint=eReg.getExportEndpoint(serviceReference,containerID);
    if (exportEndpoint != null)     return exportEndpoint;
  }
  return null;
}

Fixed version (ground truth):
private ExportEndpoint findExistingExportEndpoint(ServiceReference serviceReference,ID containerID){
  for (  org.osgi.service.remoteserviceadmin.ExportRegistration eReg : exportedRegistrations) {
    if (eReg instanceof ExportRegistration) {
      ExportEndpoint exportEndpoint=((ExportRegistration)eReg).getExportEndpoint(serviceReference,containerID);
      if (exportEndpoint != null)       return exportEndpoint;
    }
  }
  return null;
}
Program: 94184
Project: 94184
Buggy source:
public Collection<org.osgi.service.remoteserviceadmin.ExportReference> getExportedServices(){
  Collection<org.osgi.service.remoteserviceadmin.ExportReference> results=new ArrayList<org.osgi.service.remoteserviceadmin.ExportReference>();
synchronized (exportedRegistrations) {
    if (exportedRegistrations.isEmpty())     checkRSAReadAccess();
    for (    ExportRegistration reg : exportedRegistrations) {
      org.osgi.service.remoteserviceadmin.ExportReference eRef=reg.getExportReference();
      if (eRef != null && checkEndpointPermissionRead("String_Node_Str",eRef.getExportedEndpoint()))       results.add(eRef);
    }
  }
  return results;
}

Fixed version (ground truth):
public Collection<org.osgi.service.remoteserviceadmin.ExportReference> getExportedServices(){
  Collection<org.osgi.service.remoteserviceadmin.ExportReference> results=new ArrayList<org.osgi.service.remoteserviceadmin.ExportReference>();
synchronized (exportedRegistrations) {
    if (exportedRegistrations.isEmpty())     checkRSAReadAccess();
    for (    org.osgi.service.remoteserviceadmin.ExportRegistration reg : exportedRegistrations) {
      org.osgi.service.remoteserviceadmin.ExportReference eRef=reg.getExportReference();
      if (eRef != null && checkEndpointPermissionRead("String_Node_Str",eRef.getExportedEndpoint()))       results.add(eRef);
    }
  }
  return results;
}
Program: 94185
Project: 94185
Buggy source:
public Collection<org.osgi.service.remoteserviceadmin.ImportReference> getImportedEndpoints(){
  Collection<org.osgi.service.remoteserviceadmin.ImportReference> results=new ArrayList<org.osgi.service.remoteserviceadmin.ImportReference>();
synchronized (importedRegistrations) {
    if (importedRegistrations.isEmpty())     checkRSAReadAccess();
    for (    ImportRegistration reg : importedRegistrations) {
      org.osgi.service.remoteserviceadmin.ImportReference iRef=reg.getImportReference();
      if (iRef != null && checkEndpointPermissionRead("String_Node_Str",iRef.getImportedEndpoint()))       results.add(iRef);
    }
  }
  return results;
}

Fixed version (ground truth):
public Collection<org.osgi.service.remoteserviceadmin.ImportReference> getImportedEndpoints(){
  Collection<org.osgi.service.remoteserviceadmin.ImportReference> results=new ArrayList<org.osgi.service.remoteserviceadmin.ImportReference>();
synchronized (importedRegistrations) {
    if (importedRegistrations.isEmpty())     checkRSAReadAccess();
    for (    org.osgi.service.remoteserviceadmin.ImportRegistration reg : importedRegistrations) {
      org.osgi.service.remoteserviceadmin.ImportReference iRef=reg.getImportReference();
      if (iRef != null && checkEndpointPermissionRead("String_Node_Str",iRef.getImportedEndpoint()))       results.add(iRef);
    }
  }
  return results;
}
Program: 94188
Project: 94188
Buggy source:
ServiceReference getServiceReference(){
  return exportReference.getExportedService();
}

Fixed version (ground truth):
ServiceReference getServiceReference(){
  return (closed) ? null : exportReference.getExportedService();
}
Program: 94189
Project: 94189
Buggy source:
ImportEndpoint getImportEndpoint(EndpointDescription ed){
  return importReference.match(ed);
}

Fixed version (ground truth):
ImportEndpoint getImportEndpoint(EndpointDescription ed){
  return (closed) ? null : importReference.match(ed);
}
Program: 94192
Project: 94192
Buggy source:
public org.osgi.service.remoteserviceadmin.ImportReference getImportReference(){
  Throwable t=getException();
  if (t != null)   return null;
  return importReference;
}

Fixed version (ground truth):
public org.osgi.service.remoteserviceadmin.ImportReference getImportReference(){
  Throwable t=getException();
  if (t != null)   return null;
  return (closed) ? null : importReference;
}
Program: 94193
Project: 94193
Buggy source:
public org.osgi.service.remoteserviceadmin.ExportReference getExportReference(){
  Throwable t=getException();
  if (t != null)   return null;
  return exportReference;
}

Fixed version (ground truth):
public org.osgi.service.remoteserviceadmin.ExportReference getExportReference(){
  Throwable t=getException();
  if (t != null)   return null;
  return (closed) ? null : exportReference;
}
Program: 94194
Project: 94194
Buggy source:
ExportRegistration(Throwable exception,EndpointDescription errorEndpointDescription){
  Assert.isNotNull(exception);
  this.exportReference=new ExportReference(exception,errorEndpointDescription);
  this.closed=true;
}

Fixed version (ground truth):
ExportRegistration(Throwable exception,EndpointDescription errorEndpointDescription){
  Assert.isNotNull(exception);
  this.exportReference=new ExportReference(exception,errorEndpointDescription);
}
Program: 94196
Project: 94196
Buggy source:
/** 
 * transforms a string list into an array of Strings.
 * @param data the string list.
 * @param delim the list delimiter.
 * @return the array of strings.
 * @since 0.2
 */
public static String[] stringToArray(final String data,final String delim){
  final StringTokenizer tokenizer=new StringTokenizer(data,delim);
  final String[] tokens=new String[tokenizer.countTokens()];
  final int tokenCount=tokenizer.countTokens();
  for (int i=0; i < tokenCount; i++) {
    tokens[i]=tokenizer.nextToken().trim();
  }
  return tokens;
}

Fixed version (ground truth):
/** 
 * transforms a string list into an array of Strings.
 * @param data the string list.
 * @param delim the list delimiter.
 * @return the array of strings.
 * @since 0.2
 */
public static String[] stringToArray(final String data,final String delim){
  if (data == null) {
    return new String[0];
  }
  final List tokens=new ArrayList(data.length() / 10);
  int pointer=0;
  int quotePointer=0;
  int tokenStart=0;
  int nextDelimiter;
  while ((nextDelimiter=data.indexOf(delim,pointer)) > -1) {
    final int openingQuote=data.indexOf("String_Node_Str",quotePointer);
    int closingQuote=data.indexOf("String_Node_Str",openingQuote + 1);
    if (openingQuote > closingQuote) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    if (openingQuote > -1 && openingQuote < nextDelimiter && closingQuote < nextDelimiter) {
      quotePointer=++closingQuote;
      continue;
    }
    if (openingQuote < nextDelimiter && nextDelimiter < closingQuote) {
      pointer=++closingQuote;
      continue;
    }
    tokens.add(data.substring(tokenStart,nextDelimiter).trim());
    pointer=++nextDelimiter;
    quotePointer=pointer;
    tokenStart=pointer;
  }
  tokens.add(data.substring(tokenStart).trim());
  return (String[])tokens.toArray(new String[tokens.size()]);
}
Program: 94197
Project: 94197
Buggy source:
/** 
 * R \ L (comparison operation allows wildcards)
 * @param left A set of matchers (supports wildcard at end)
 * @param right A set of inputs
 * @return The subset of right with all elements removed matching left 
 * @since 1.0
 */
public static Collection rightDifference(Collection left,Collection right){
  final List result=new ArrayList(right);
  for (Iterator iterator=right.iterator(); iterator.hasNext(); ) {
    final String f1=(String)iterator.next();
    for (Iterator itr2=left.iterator(); itr2.hasNext(); ) {
      String f2=(String)itr2.next();
      if (f2.endsWith("String_Node_Str")) {
        f2=f2.substring(0,f2.length() - 1);
        if (f1.startsWith(f2)) {
          result.remove(f1);
        }
      }
 else {
        if (f1.equals(f2)) {
          result.remove(f1);
        }
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * R \ L (comparison operation allows wildcards)
 * @param left A set of matchers (supports wildcard at end)
 * @param right A set of inputs
 * @return The subset of right with all elements removed matching left
 * @since 1.0
 */
public static Collection rightDifference(Collection left,Collection right){
  final List result=new ArrayList(right);
  for (Iterator iterator=right.iterator(); iterator.hasNext(); ) {
    final String f1=(String)iterator.next();
    for (Iterator itr2=left.iterator(); itr2.hasNext(); ) {
      String f2=(String)itr2.next();
      if (f2.endsWith("String_Node_Str")) {
        f2=f2.substring(0,f2.length() - 1);
        if (f1.startsWith(f2)) {
          result.remove(f1);
        }
      }
 else {
        if (f1.equals(f2)) {
          result.remove(f1);
        }
      }
    }
  }
  return result;
}
Program: 94198
Project: 94198
Buggy source:
private void installResolveAndStartBundle(final RemoteServiceReference ref,final InputStream in,final boolean isProxy){
  try {
    final Bundle bundle=RemoteOSGiActivator.getActivator().getContext().installBundle(ref.getURI().toString(),in);
    retrieveDependencies((String)bundle.getHeaders().get(Constants.IMPORT_PACKAGE),(String)bundle.getHeaders().get(Constants.EXPORT_PACKAGE));
    if (isProxy) {
      proxyBundles.put(ref.getURI().getFragment(),bundle);
    }
    System.err.println(RemoteOSGiActivator.getActivator().getContext().getDataFile("String_Node_Str").getAbsolutePath());
    bundle.start();
  }
 catch (  final BundleException e) {
    final Throwable nested=e.getNestedException() == null ? e : e.getNestedException();
    nested.printStackTrace();
    throw new RemoteOSGiException("String_Node_Str" + ref.toString(),nested);
  }
}

Fixed version (ground truth):
private void installResolveAndStartBundle(final RemoteServiceReference ref,final InputStream in,final boolean isProxy){
  try {
    final Bundle bundle=RemoteOSGiActivator.getActivator().getContext().installBundle(ref.getURI().toString(),in);
    retrieveDependencies((String)bundle.getHeaders().get(Constants.IMPORT_PACKAGE),(String)bundle.getHeaders().get(Constants.EXPORT_PACKAGE));
    if (isProxy) {
      proxyBundles.put(ref.getURI().getFragment(),bundle);
    }
    bundle.start();
  }
 catch (  final BundleException e) {
    final Throwable nested=e.getNestedException() == null ? e : e.getNestedException();
    nested.printStackTrace();
    throw new RemoteOSGiException("String_Node_Str" + ref.toString(),nested);
  }
}
Program: 94199
Project: 94199
Buggy source:
protected void handleServiceRegistering(ServiceReference serviceReference){
  String[] exportedInterfaces=PropertiesUtil.getExportedInterfaces(serviceReference);
  if (exportedInterfaces == null)   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);
  getRemoteServiceAdmin().exportService(serviceReference,exportProperties);
}
Program: 94201
Project: 94201
Buggy source:
public void stop(BundleContext bundleContext) throws Exception {
  if (endpointDescriptionLocator != null) {
    endpointDescriptionLocator.close();
    endpointDescriptionLocator=null;
  }
  if (remoteServiceAdminRegistration != null) {
    remoteServiceAdminRegistration.unregister();
    remoteServiceAdminRegistration=null;
  }
  clearRSAs();
  if (iServiceInfoFactoryRegistration != null) {
    iServiceInfoFactoryRegistration.unregister();
    iServiceInfoFactoryRegistration=null;
  }
synchronized (saxParserFactoryTrackerLock) {
    if (saxParserFactoryTracker != null) {
      saxParserFactoryTracker.close();
      saxParserFactoryTracker=null;
    }
  }
synchronized (logServiceTrackerLock) {
    if (logServiceTracker != null) {
      logServiceTracker.close();
      logServiceTracker=null;
      logService=null;
    }
  }
  stopProxyServiceFactoryBundle();
  Activator.context=null;
  Activator.instance=null;
}

Fixed version (ground truth):
public void stop(BundleContext bundleContext) throws Exception {
  if (endpointDescriptionLocator != null) {
    endpointDescriptionLocator.close();
    endpointDescriptionLocator=null;
  }
  if (ctdTracker != null) {
    ctdTracker.close();
    ctdTracker=null;
  }
  if (remoteServiceAdminRegistration != null) {
    remoteServiceAdminRegistration.unregister();
    remoteServiceAdminRegistration=null;
  }
  clearRSAs();
  if (iServiceInfoFactoryRegistration != null) {
    iServiceInfoFactoryRegistration.unregister();
    iServiceInfoFactoryRegistration=null;
  }
synchronized (saxParserFactoryTrackerLock) {
    if (saxParserFactoryTracker != null) {
      saxParserFactoryTracker.close();
      saxParserFactoryTracker=null;
    }
  }
synchronized (logServiceTrackerLock) {
    if (logServiceTracker != null) {
      logServiceTracker.close();
      logServiceTracker=null;
      logService=null;
    }
  }
  stopProxyServiceFactoryBundle();
  Activator.context=null;
  Activator.instance=null;
}
Program: 94202
Project: 94202
Buggy source:
public AbstractTopologyManager(BundleContext context){
  serviceInfoFactoryTracker=new ServiceTracker(Activator.getContext(),createISIFFilter(Activator.getContext()),null);
  serviceInfoFactoryTracker.open();
  this.context=context;
  this.registrationLock=new ReentrantLock(true);
}

Fixed version (ground truth):
public AbstractTopologyManager(BundleContext context){
  serviceInfoFactoryTracker=new ServiceTracker(context,createISIFFilter(context),null);
  serviceInfoFactoryTracker.open();
  this.context=context;
  this.registrationLock=new ReentrantLock(true);
}
Program: 94207
Project: 94207
Buggy source:
private void verifyECFProperties(){
  this.idNamespace=verifyStringProperty(RemoteConstants.ENDPOINT_CONTAINER_ID_NAMESPACE);
  this.containerID=verifyIDProperty(idNamespace,getId());
  this.connectTargetID=verifyIDProperty(RemoteConstants.ENDPOINT_CONNECTTARGET_ID);
  this.idFilter=verifyIDFilter();
  this.rsFilter=verifyStringProperty(RemoteConstants.ENDPOINT_REMOTESERVICE_FILTER);
}

Fixed version (ground truth):
private void verifyECFProperties(){
  this.ecfid=verifyStringProperty(RemoteConstants.ENDPOINT_ID);
  if (this.ecfid == null) {
    LogUtility.logWarning("String_Node_Str",DebugOptions.ENDPOINT_DESCRIPTION_READER,EndpointDescription.class,"String_Node_Str" + RemoteConstants.ENDPOINT_ID + "String_Node_Str");
    this.ecfid=getId();
  }
  this.timestamp=verifyLongProperty(RemoteConstants.ENDPOINT_TIMESTAMP);
  if (this.timestamp == null) {
    LogUtility.logWarning("String_Node_Str",DebugOptions.ENDPOINT_DESCRIPTION_READER,EndpointDescription.class,"String_Node_Str" + RemoteConstants.ENDPOINT_TIMESTAMP + "String_Node_Str");
    this.timestamp=getServiceId();
  }
  this.idNamespace=verifyStringProperty(RemoteConstants.ENDPOINT_CONTAINER_ID_NAMESPACE);
  this.containerID=verifyIDProperty(idNamespace,this.ecfid);
  this.rsId=verifyLongProperty(Constants.SERVICE_ID);
  if (this.rsId == null)   this.rsId=getServiceId();
  this.connectTargetID=verifyIDProperty(RemoteConstants.ENDPOINT_CONNECTTARGET_ID);
  this.idFilter=verifyIDFilter();
  this.rsFilter=verifyStringProperty(RemoteConstants.ENDPOINT_REMOTESERVICE_FILTER);
}
Program: 94208
Project: 94208
Buggy source:
public String toString(){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append("String_Node_Str").append(getId());
  sb.append("String_Node_Str").append(getServiceId());
  sb.append("String_Node_Str").append(getFrameworkUUID()).append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append(getProperties()).append("String_Node_Str");
  return sb.toString();
}
Program: 94209
Project: 94209
Buggy source:
public synchronized void takeOffTheAir(){
  trace("String_Node_Str" + getName() + "String_Node_Str");
  if (listenerThread != null) {
    listenerThread.interrupt();
    listenerThread=null;
  }
  if (threadGroup != null) {
    threadGroup.interrupt();
    threadGroup=null;
  }
  isOnTheAir=false;
}

Fixed version (ground truth):
public synchronized void takeOffTheAir(){
  trace("String_Node_Str" + getName() + "String_Node_Str");
  if (listenerThread != null) {
    listenerThread.interrupt();
    listenerThread=null;
  }
  if (threadGroup != null) {
    threadGroup.interrupt();
    threadGroup=null;
  }
  if (this.serverSocket != null) {
    try {
      this.serverSocket.close();
    }
 catch (    IOException e) {
      Trace.catching("String_Node_Str",ECFProviderDebugOptions.CONNECTION,SSLServerSOContainerGroup.class,"String_Node_Str",e);
    }
    this.serverSocket=null;
  }
  isOnTheAir=false;
}
Program: 94210
Project: 94210
Buggy source:
public Client3(){
  super();
  setMessageReceiver(new IMessageReceiver(){
    public void handleMessage(    final IChatMessage chatMessage){
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          MessageDialog.openInformation(null,"String_Node_Str" + chatMessage.getFromID().getName(),chatMessage.getBody());
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
public Client3(){
  super(new IMessageReceiver(){
    public void handleMessage(    final IChatMessage chatMessage){
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          MessageDialog.openInformation(null,"String_Node_Str" + chatMessage.getFromID().getName(),chatMessage.getBody());
        }
      }
);
    }
  }
);
}