Program: 94190
Project: 94190
Buggy source:
public void close(){
  trace("String_Node_Str","String_Node_Str" + importedRegistrations + "String_Node_Str"+ exportedRegistrations);
  List<org.osgi.service.remoteserviceadmin.ImportRegistration> toClose=null;
synchronized (importedRegistrations) {
    toClose=new ArrayList<org.osgi.service.remoteserviceadmin.ImportRegistration>(localImportedRegistrations);
    localImportedRegistrations.clear();
  }
  for (  org.osgi.service.remoteserviceadmin.ImportRegistration reg : toClose)   reg.close();
  List<org.osgi.service.remoteserviceadmin.ExportRegistration> toClose1=null;
synchronized (localExportedRegistrations) {
    toClose1=new ArrayList<org.osgi.service.remoteserviceadmin.ExportRegistration>(localExportedRegistrations);
    localExportedRegistrations.clear();
  }
  for (  org.osgi.service.remoteserviceadmin.ExportRegistration reg1 : toClose1)   reg1.close();
synchronized (remoteServiceAdminListenerTrackerLock) {
    if (remoteServiceAdminListenerTracker != null) {
      remoteServiceAdminListenerTracker.close();
      remoteServiceAdminListenerTracker=null;
    }
  }
synchronized (eventAdminTrackerLock) {
    if (eventAdminTracker != null) {
      eventAdminTracker.close();
      eventAdminTracker=null;
    }
  }
synchronized (proxyClassLoaders) {
    proxyClassLoaders.clear();
  }
synchronized (consumerContainerSelectorTrackerLock) {
    if (consumerContainerSelectorTracker != null) {
      consumerContainerSelectorTracker.close();
      consumerContainerSelectorTracker=null;
    }
  }
  if (defaultConsumerContainerSelector != null) {
    defaultConsumerContainerSelector.close();
    defaultConsumerContainerSelector=null;
  }
synchronized (hostContainerSelectorTrackerLock) {
    if (hostContainerSelectorTracker != null) {
      hostContainerSelectorTracker.close();
      hostContainerSelectorTracker=null;
    }
  }
  if (defaultHostContainerSelector != null) {
    defaultHostContainerSelector.close();
    defaultHostContainerSelector=null;
  }
  if (defaultHostContainerSelectorRegistration != null) {
    defaultHostContainerSelectorRegistration.unregister();
    defaultHostContainerSelectorRegistration=null;
  }
  if (defaultHostContainerSelector != null) {
    defaultHostContainerSelector.close();
    defaultHostContainerSelector=null;
  }
  if (defaultConsumerContainerSelectorRegistration != null) {
    defaultConsumerContainerSelectorRegistration.unregister();
    defaultConsumerContainerSelectorRegistration=null;
  }
  if (defaultConsumerContainerSelector != null) {
    defaultConsumerContainerSelector.close();
    defaultConsumerContainerSelector=null;
  }
  if (eventListenerHookRegistration != null) {
    eventListenerHookRegistration.unregister();
    eventListenerHookRegistration=null;
  }
}

Fixed version (ground truth):
public void close(){
  trace("String_Node_Str","String_Node_Str" + importedRegistrations + "String_Node_Str"+ exportedRegistrations);
  List<org.osgi.service.remoteserviceadmin.ImportRegistration> toClose=null;
synchronized (importedRegistrations) {
    toClose=new ArrayList<org.osgi.service.remoteserviceadmin.ImportRegistration>(localImportedRegistrations);
  }
  for (  org.osgi.service.remoteserviceadmin.ImportRegistration reg : toClose)   reg.close();
  List<org.osgi.service.remoteserviceadmin.ExportRegistration> toClose1=null;
synchronized (localExportedRegistrations) {
    toClose1=new ArrayList<org.osgi.service.remoteserviceadmin.ExportRegistration>(localExportedRegistrations);
  }
  for (  org.osgi.service.remoteserviceadmin.ExportRegistration reg1 : toClose1)   reg1.close();
  this.localExportedRegistrations.clear();
  this.localImportedRegistrations.clear();
synchronized (remoteServiceAdminListenerTrackerLock) {
    if (remoteServiceAdminListenerTracker != null) {
      remoteServiceAdminListenerTracker.close();
      remoteServiceAdminListenerTracker=null;
    }
  }
synchronized (eventAdminTrackerLock) {
    if (eventAdminTracker != null) {
      eventAdminTracker.close();
      eventAdminTracker=null;
    }
  }
synchronized (proxyClassLoaders) {
    proxyClassLoaders.clear();
  }
synchronized (consumerContainerSelectorTrackerLock) {
    if (consumerContainerSelectorTracker != null) {
      consumerContainerSelectorTracker.close();
      consumerContainerSelectorTracker=null;
    }
  }
  if (defaultConsumerContainerSelector != null) {
    defaultConsumerContainerSelector.close();
    defaultConsumerContainerSelector=null;
  }
synchronized (hostContainerSelectorTrackerLock) {
    if (hostContainerSelectorTracker != null) {
      hostContainerSelectorTracker.close();
      hostContainerSelectorTracker=null;
    }
  }
  if (defaultHostContainerSelector != null) {
    defaultHostContainerSelector.close();
    defaultHostContainerSelector=null;
  }
  if (defaultHostContainerSelectorRegistration != null) {
    defaultHostContainerSelectorRegistration.unregister();
    defaultHostContainerSelectorRegistration=null;
  }
  if (defaultHostContainerSelector != null) {
    defaultHostContainerSelector.close();
    defaultHostContainerSelector=null;
  }
  if (defaultConsumerContainerSelectorRegistration != null) {
    defaultConsumerContainerSelectorRegistration.unregister();
    defaultConsumerContainerSelectorRegistration=null;
  }
  if (defaultConsumerContainerSelector != null) {
    defaultConsumerContainerSelector.close();
    defaultConsumerContainerSelector=null;
  }
  if (eventListenerHookRegistration != null) {
    eventListenerHookRegistration.unregister();
    eventListenerHookRegistration=null;
  }
}