nus-yam/ex-repair huggingface dataset:
Program: 94385
Project: 94385
Buggy source:
/** 
 * @since 3.0
 */
public AddRegistrationRequest(ID targetID,String service,String filter,AddRegistrationRequest parent){
  this.targetID=null;
  Assert.isNotNull(service);
  this.service=service;
  this.filter=filter;
  this.parent=parent;
}

Fixed version (ground truth):
/** 
 * @since 3.3
 */
public AddRegistrationRequest(String service,String filter,Vector requests){
  this.parent=null;
  this.targetID=null;
  Assert.isNotNull(service);
  this.service=service;
  this.filter=filter;
  this.requests=requests;
  if (requests != null)   requests.add(this);
}
Program: 94386
Project: 94386
Buggy source:
public void waitForResponse(long timeout){
  long startTime=System.currentTimeMillis();
  long endTime=startTime + timeout;
synchronized (this) {
    while (!done && (endTime >= System.currentTimeMillis())) {
      try {
        wait(timeout / 10);
      }
 catch (      InterruptedException e) {
        return;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * @since 3.3
 */
public void waitForResponse(long timeout){
  long startTime=System.currentTimeMillis();
  long endTime=startTime + timeout;
synchronized (this) {
    while (!done && (endTime >= System.currentTimeMillis())) {
      try {
        wait(timeout / 10);
      }
 catch (      InterruptedException e) {
        return;
      }
    }
  }
}
Program: 94389
Project: 94389
Buggy source:
protected boolean matchHostSupportedConfigTypes(String[] serviceRequiredConfigTypes,ContainerTypeDescription containerTypeDescription){
  if (serviceRequiredConfigTypes == null)   return true;
  String[] supportedConfigTypes=getSupportedConfigTypes(containerTypeDescription);
  if (supportedConfigTypes == null)   return false;
  List supportedConfigTypeList=Arrays.asList(supportedConfigTypes);
  boolean result=true;
  for (int i=0; i < serviceRequiredConfigTypes.length; i++)   result=result && supportedConfigTypeList.contains(serviceRequiredConfigTypes[i]);
  return result;
}

Fixed version (ground truth):
protected boolean matchHostSupportedConfigTypes(String[] serviceRequiredConfigTypes,ContainerTypeDescription containerTypeDescription){
  String[] supportedConfigTypes=getSupportedConfigTypes(containerTypeDescription);
  if (supportedConfigTypes == null || supportedConfigTypes.length == 0)   return false;
  List supportedConfigTypesList=Arrays.asList(supportedConfigTypes);
  if (serviceRequiredConfigTypes == null)   return matchDefaultConfigTypes(supportedConfigTypesList);
  boolean result=true;
  List requiredConfigTypesList=Arrays.asList(serviceRequiredConfigTypes);
  for (Iterator i=requiredConfigTypesList.iterator(); i.hasNext(); )   result=result && supportedConfigTypesList.contains(i.next());
  if (!result) {
    if (!requiredConfigTypesList.contains(NODEFAULT))     return matchDefaultConfigTypes(supportedConfigTypesList);
  }
  return result;
}
Program: 94390
Project: 94390
Buggy source:
public DefaultHostContainerFinder(boolean autoCreateContainer){
  this.autoCreateContainer=autoCreateContainer;
}

Fixed version (ground truth):
public DefaultHostContainerFinder(boolean autoCreateContainer,String[] defaultConfigTypes){
  super(defaultConfigTypes);
  this.autoCreateContainer=autoCreateContainer;
}
Program: 94391
Project: 94391
Buggy source:
protected void handleCallRequest(Request request){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",request);
  final ID responseTarget=request.getRequestContainerID();
  final RemoteServiceRegistrationImpl localRegistration=getLocalRegistrationForRequest(request);
  final RemoteCallImpl call=request.getCall();
  Response response=null;
  Object result=null;
  try {
    result=localRegistration.callService(call);
    response=new Response(request.getRequestId(),result);
  }
 catch (  final Exception e) {
    response=new Response(request.getRequestId(),e);
    log(SERVICE_INVOKE_ERROR_CODE,SERVICE_INVOKE_ERROR_MESSAGE,e);
  }
  sendCallResponse(responseTarget,response);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}

Fixed version (ground truth):
protected void handleCallRequest(Request request){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),"String_Node_Str",request);
  final ID responseTarget=request.getRequestContainerID();
  final RemoteServiceRegistrationImpl localRegistration=getLocalRegistrationForRequest(request);
  final RemoteCallImpl call=request.getCall();
  Response response=null;
  Object result=null;
  try {
    result=localRegistration.callService(call);
    response=new Response(request.getRequestId(),result);
  }
 catch (  final Exception e) {
    response=new Response(request.getRequestId(),getSerializableException(e));
    log(SERVICE_INVOKE_ERROR_CODE,SERVICE_INVOKE_ERROR_MESSAGE,e);
  }
  sendCallResponse(responseTarget,response);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),"String_Node_Str");
}
Program: 94392
Project: 94392
Buggy source:
/** 
 * @throws CredentialsNotAvailableException  
 */
public Credentials getCredentials(AuthScheme scheme,String host,int port,boolean isProxyAuthenticating) throws CredentialsNotAvailableException {
  if (!isProxyAuthenticating) {
    return null;
  }
  Proxy proxy=getECFProxy();
  if (proxy == null) {
    return null;
  }
  if ("String_Node_Str".equalsIgnoreCase(scheme.getSchemeName())) {
    return getNTLMCredentials(proxy);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(scheme.getSchemeName()) || "String_Node_Str".equalsIgnoreCase(scheme.getSchemeName())) {
    final String proxyUsername=proxy.getUsername();
    final String proxyPassword=proxy.getPassword();
    if (proxyUsername != null) {
      Credentials credentials=new UsernamePasswordCredentials(proxyUsername,proxyPassword);
      return credentials;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @throws CredentialsNotAvailableException  
 */
public Credentials getCredentials(AuthScheme scheme,String host,int port,boolean isProxyAuthenticating) throws CredentialsNotAvailableException {
  if (!isProxyAuthenticating) {
    return null;
  }
  Proxy proxy=getECFProxy();
  if (proxy == null) {
    return null;
  }
  Object provideKey=makeProvidedKey(scheme,host,port,isProxyAuthenticating);
  if (provided.contains(provideKey)) {
    return null;
  }
  provided.add(provideKey);
  if ("String_Node_Str".equalsIgnoreCase(scheme.getSchemeName())) {
    return getNTLMCredentials(proxy);
  }
 else   if ("String_Node_Str".equalsIgnoreCase(scheme.getSchemeName()) || "String_Node_Str".equalsIgnoreCase(scheme.getSchemeName())) {
    final String proxyUsername=proxy.getUsername();
    final String proxyPassword=proxy.getPassword();
    if (proxyUsername != null) {
      Credentials credentials=new UsernamePasswordCredentials(proxyUsername,proxyPassword);
      return credentials;
    }
  }
  return null;
}
Program: 94393
Project: 94393
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    try {
      IProxyService proxyService=Activator.getDefault().getProxyService();
      if (proxyService != null && proxyService.isProxiesEnabled()) {
        URI target=new URI(directoryOrFile.toExternalForm());
        final IProxyData[] proxies=proxyService.select(target);
        IProxyData selectedProxy=selectProxyFromProxies(target.getScheme(),proxies);
        if (selectedProxy != null) {
          proxy=new Proxy(((selectedProxy.getType().equalsIgnoreCase(IProxyData.SOCKS_PROXY_TYPE)) ? Proxy.Type.SOCKS : Proxy.Type.HTTP),new ProxyAddress(selectedProxy.getHost(),selectedProxy.getPort()),selectedProxy.getUserId(),selectedProxy.getPassword());
        }
      }
    }
 catch (    Exception e) {
      Activator.logNoProxyWarning(e);
    }
catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(directoryOrFile.toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94394
Project: 94394
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){
  if (proxies == null || proxies.length == 0)   return null;
  if (proxies.length == 1)   return proxies[0];
  if (protocol.equalsIgnoreCase("String_Node_Str")) {
    for (int i=0; i < proxies.length; i++) {
      if (proxies[i].getType().equals(IProxyData.HTTP_PROXY_TYPE))       return proxies[i];
    }
  }
 else   if (protocol.equalsIgnoreCase("String_Node_Str")) {
    for (int i=0; i < proxies.length; i++) {
      if (proxies[i].getType().equals(IProxyData.HTTPS_PROXY_TYPE))       return proxies[i];
    }
  }
  return proxies[0];
}

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){
  return ProxySetupHelper.selectProxyFromProxies(protocol,proxies);
}
Program: 94395
Project: 94395
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    try {
      IProxyService proxyService=Activator.getDefault().getProxyService();
      if (proxyService != null && proxyService.isProxiesEnabled()) {
        URI target=new URI(getRemoteFileURL().toExternalForm());
        String type=IProxyData.SOCKS_PROXY_TYPE;
        if (target.getScheme().equalsIgnoreCase(IProxyData.HTTP_PROXY_TYPE)) {
          type=IProxyData.HTTP_PROXY_TYPE;
        }
 else         if (target.getScheme().equalsIgnoreCase(IProxyData.HTTPS_PROXY_TYPE)) {
          type=IProxyData.HTTPS_PROXY_TYPE;
        }
        final IProxyData[] proxyDatas=proxyService.select(target);
        final IProxyData proxyData=selectProxyFromProxies(target.getScheme(),proxyDatas);
        if (proxyData != null) {
          proxy=new Proxy(((type.equalsIgnoreCase(IProxyData.SOCKS_PROXY_TYPE)) ? Proxy.Type.SOCKS : Proxy.Type.HTTP),new ProxyAddress(proxyData.getHost(),proxyData.getPort()),proxyData.getUserId(),proxyData.getPassword());
        }
      }
    }
 catch (    Exception e) {
      Activator.logNoProxyWarning(e);
    }
catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94396
Project: 94396
Buggy source:
protected void setupProxies(){
  if (proxy == null) {
    try {
      IProxyService proxyService=Activator.getDefault().getProxyService();
      if (proxyService != null && proxyService.isProxiesEnabled()) {
        URI target=new URI(getRemoteFileURL().toExternalForm());
        final IProxyData[] proxies=proxyService.select(target);
        IProxyData selectedProxy=selectProxyFromProxies(target.getScheme(),proxies);
        if (selectedProxy != null) {
          proxy=new Proxy(((selectedProxy.getType().equalsIgnoreCase(IProxyData.SOCKS_PROXY_TYPE)) ? Proxy.Type.SOCKS : Proxy.Type.HTTP),new ProxyAddress(selectedProxy.getHost(),selectedProxy.getPort()),selectedProxy.getUserId(),selectedProxy.getPassword());
        }
      }
    }
 catch (    Exception e) {
      Activator.logNoProxyWarning(e);
    }
catch (    NoClassDefFoundError e) {
      Activator.logNoProxyWarning(e);
    }
  }
  if (proxy != null)   setupProxy(proxy);
}

Fixed version (ground truth):
protected void setupProxies(){
  if (proxy == null) {
    proxy=ProxySetupHelper.getProxy(getRemoteFileURL().toExternalForm());
  }
  if (proxy != null)   setupProxy(proxy);
}
Program: 94397
Project: 94397
Buggy source:
public void setupProxy(final Proxy proxy2){
  Properties systemProperties=System.getProperties();
  proxyHostProperty=(proxy2.getType().equals(Proxy.Type.HTTP)) ? HTTP_PROXY_HOST_SYSTEM_PROPERTY : SOCKS_PROXY_HOST_SYSTEM_PROPERTY;
  proxyPortProperty=(proxy2.getType().equals(Proxy.Type.HTTP)) ? HTTP_PROXY_PORT_SYSTEM_PROPERTY : SOCKS_PROXY_PORT_SYSTEM_PROPERTY;
  oldHost=systemProperties.getProperty(proxyHostProperty);
  if (oldHost != null) {
    oldPort=systemProperties.getProperty(proxyPortProperty);
  }
  systemProperties.setProperty(proxyHostProperty,proxy2.getAddress().getHostName());
  int proxyPort=proxy2.getAddress().getPort();
  if (proxyPort != -1)   systemProperties.setProperty(proxyPortProperty,proxyPort + "String_Node_Str");
  final String username=proxy2.getUsername();
  if (username != null && !username.equals("String_Node_Str")) {
    final String password=(proxy2.getPassword() == null) ? "String_Node_Str" : proxy2.getPassword();
    if (proxy2.hasCredentials()) {
      Authenticator.setDefault(new Authenticator(){
        protected PasswordAuthentication getPasswordAuthentication(){
          return new PasswordAuthentication(username,password.toCharArray());
        }
      }
);
    }
  }
}

Fixed version (ground truth):
public void setupProxy(final Proxy proxy2){
  Properties systemProperties=System.getProperties();
  proxyHostProperty=(proxy2.getType().equals(Proxy.Type.HTTP)) ? HTTP_PROXY_HOST_SYSTEM_PROPERTY : SOCKS_PROXY_HOST_SYSTEM_PROPERTY;
  proxyPortProperty=(proxy2.getType().equals(Proxy.Type.HTTP)) ? HTTP_PROXY_PORT_SYSTEM_PROPERTY : SOCKS_PROXY_PORT_SYSTEM_PROPERTY;
  oldHost=systemProperties.getProperty(proxyHostProperty);
  if (oldHost != null) {
    oldPort=systemProperties.getProperty(proxyPortProperty);
  }
  systemProperties.setProperty(proxyHostProperty,proxy2.getAddress().getHostName());
  int proxyPort=proxy2.getAddress().getPort();
  if (proxyPort != -1)   systemProperties.setProperty(proxyPortProperty,proxyPort + "String_Node_Str");
  final String username=proxy2.getUsername();
  boolean setAuthenticator=false;
  if (username != null && !username.equals("String_Node_Str")) {
    final String password=(proxy2.getPassword() == null) ? "String_Node_Str" : proxy2.getPassword();
    if (proxy2.hasCredentials()) {
      Authenticator.setDefault(new Authenticator(){
        protected PasswordAuthentication getPasswordAuthentication(){
          return new PasswordAuthentication(username,password.toCharArray());
        }
      }
);
      setAuthenticator=true;
    }
  }
  if (!setAuthenticator) {
    Authenticator.setDefault(new Authenticator(){
      protected PasswordAuthentication getPasswordAuthentication(){
        return null;
      }
    }
);
  }
}
Program: 94398
Project: 94398
Buggy source:
protected PasswordAuthentication getPasswordAuthentication(){
  return new PasswordAuthentication(username,password.toCharArray());
}

Fixed version (ground truth):
protected PasswordAuthentication getPasswordAuthentication(){
  return null;
}
Program: 94399
Project: 94399
Buggy source:
/** 
 * This method will be invoked by an arbitrary thread when an asynchronous remote service call fails.  Only this method xor   {@link #onSuccess(Object)} will be calledfor a given remote call.
 * @param t any exception associated with the failure.  Will not be <code>null</code>.
 */
public void onFailure(Throwable exception);

Fixed version (ground truth):
/** 
 * This method will be invoked by an arbitrary thread when an asynchronous remote service call fails.  Only this method xor   {@link #onSuccess(Object)} will be calledfor a given remote call.
 * @param exception any exception associated with the failure.  Will not be <code>null</code>.
 */
public void onFailure(Throwable exception);
Program: 94400
Project: 94400
Buggy source:
private synchronized List getRemoteServiceReferencesConnected(final String clazz,IRemoteFilter filter){
  List results=new ArrayList();
  final RemoteServiceReference[] refs=remoteService.getRemoteServiceReferences(connectedID.getURI(),clazz,filter);
  if (refs == null)   return results;
  for (int i=0; i < refs.length; i++)   results.add(new RemoteServiceReferenceImpl(createRemoteServiceID(refs[i]),refs[i]));
  return results;
}

Fixed version (ground truth):
private synchronized List getRemoteServiceReferencesConnected(final String clazz,IRemoteFilter filter){
  List results=new ArrayList();
  if (connectedID == null) {
    try {
      IRemoteServiceReference[] refs=getAllRemoteServiceReferences(clazz,(filter == null) ? null : filter.toString());
      if (refs == null)       return results;
      for (int i=0; i < refs.length; i++)       results.add(refs[i]);
    }
 catch (    InvalidSyntaxException e) {
    }
  }
 else {
    RemoteServiceReference[] rrefs=remoteService.getRemoteServiceReferences(connectedID.getURI(),clazz,filter);
    if (rrefs == null)     return results;
    for (int i=0; i < rrefs.length; i++)     results.add(new RemoteServiceReferenceImpl(createRemoteServiceID(rrefs[i]),rrefs[i]));
  }
  return results;
}
Program: 94401
Project: 94401
Buggy source:
public String getScheme(){
  return LongID.class.toString();
}

Fixed version (ground truth):
public String getScheme(){
  return LongID.class.getName();
}
Program: 94402
Project: 94402
Buggy source:
protected void handleAddRegistration(ID remoteContainerID,Integer requestId,final RemoteServiceRegistrationImpl registration){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),ADD_REGISTRATION,new Object[]{remoteContainerID,registration});
  if (remoteContainerID == null || getLocalContainerID().equals(remoteContainerID)) {
    return;
  }
  boolean added=false;
synchronized (remoteRegistrys) {
    RemoteServiceRegistryImpl registry=getRemoteRegistry(remoteContainerID);
    if (registry == null) {
      registry=new RemoteServiceRegistryImpl(remoteContainerID);
      addRemoteRegistry(registry);
    }
    RemoteServiceRegistrationImpl[] regs=registry.getRegistrations();
    List regList=Arrays.asList(regs);
    if (!regList.contains(registration)) {
      added=true;
      registry.publishService(registration);
      localRegisterService(registration);
    }
    notifyAddRegistrationResponse(remoteContainerID,requestId,null);
  }
  if (added)   fireRemoteServiceListeners(createRegisteredEvent(registration));
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),ADD_REGISTRATION);
}

Fixed version (ground truth):
protected void handleAddRegistration(ID remoteContainerID,Integer requestId,final RemoteServiceRegistrationImpl registration){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),ADD_REGISTRATION,new Object[]{remoteContainerID,registration});
  ID localContainerID=getLocalContainerID();
  if (remoteContainerID == null || localContainerID == null || localContainerID.equals(remoteContainerID)) {
    return;
  }
  boolean added=false;
synchronized (remoteRegistrys) {
    RemoteServiceRegistryImpl registry=getRemoteRegistry(remoteContainerID);
    if (registry == null) {
      registry=new RemoteServiceRegistryImpl(remoteContainerID);
      addRemoteRegistry(registry);
    }
    RemoteServiceRegistrationImpl[] regs=registry.getRegistrations();
    List regList=Arrays.asList(regs);
    if (!regList.contains(registration)) {
      added=true;
      registry.publishService(registration);
      localRegisterService(registration);
    }
    notifyAddRegistrationResponse(remoteContainerID,requestId,null);
  }
  if (added)   fireRemoteServiceListeners(createRegisteredEvent(registration));
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),ADD_REGISTRATION);
}
Program: 94403
Project: 94403
Buggy source:
protected void handleRegistryUpdateRequest(ID remoteContainerID){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),REGISTRY_UPDATE_REQUEST);
  if (remoteContainerID == null || getLocalContainerID().equals(remoteContainerID)) {
    return;
  }
  sendRegistryUpdate(remoteContainerID);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),REGISTRY_UPDATE_REQUEST);
}

Fixed version (ground truth):
protected void handleRegistryUpdateRequest(ID remoteContainerID){
  Trace.entering(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_ENTERING,this.getClass(),REGISTRY_UPDATE_REQUEST);
  ID localContainerID=getLocalContainerID();
  if (remoteContainerID == null || localContainerID == null || localContainerID.equals(remoteContainerID)) {
    return;
  }
  sendRegistryUpdate(remoteContainerID);
  Trace.exiting(Activator.PLUGIN_ID,IRemoteServiceProviderDebugOptions.METHODS_EXITING,this.getClass(),REGISTRY_UPDATE_REQUEST);
}
Program: 94404
Project: 94404
Buggy source:
protected void createAndInitializeServer(String path,int keepAlive) throws IDCreateException {
  if (path == null || path.equals("String_Node_Str"))   throw new NullPointerException("String_Node_Str");
  GenericServerContainer s=new GenericServerContainer(this,createServerConfig(path),serverGroup,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
  containerManager.addContainer(s,ctd);
  IConnectHandlerPolicy policy=createConnectHandlerPolicy(s,path);
  if (policy != null)   s.setConnectPolicy(policy);
}

Fixed version (ground truth):
protected void createAndInitializeServer(String path,int keepAlive) throws IDCreateException {
  if (path == null || path.equals("String_Node_Str"))   throw new NullPointerException("String_Node_Str");
  GenericServerContainer s=new GenericServerContainer(this,createServerConfig(path),serverGroup,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  if (containerManager != null) {
    ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
    containerManager.addContainer(s,ctd);
  }
  IConnectHandlerPolicy policy=createConnectHandlerPolicy(s,path);
  if (policy != null)   s.setConnectPolicy(policy);
}
Program: 94405
Project: 94405
Buggy source:
private TCPServerSOContainer createServerContainer(String id,TCPServerSOContainerGroup group,String path,int keepAlive) throws IDCreateException {
  final ID newServerID=IDFactory.getDefault().createStringID(id);
  TCPServerSOContainer container=new TCPServerSOContainer(new SOContainerConfig(newServerID),group,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
  containerManager.addContainer(container,ctd);
  return container;
}

Fixed version (ground truth):
private TCPServerSOContainer createServerContainer(String id,TCPServerSOContainerGroup group,String path,int keepAlive) throws IDCreateException {
  final ID newServerID=IDFactory.getDefault().createStringID(id);
  TCPServerSOContainer container=new TCPServerSOContainer(new SOContainerConfig(newServerID),group,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  if (containerManager != null) {
    ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
    containerManager.addContainer(container,ctd);
  }
  return container;
}
Program: 94406
Project: 94406
Buggy source:
protected void createAndInitializeServer(String path,int keepAlive) throws IDCreateException {
  if (path == null || path.equals("String_Node_Str"))   throw new NullPointerException("String_Node_Str");
  GenericServerContainer s=new GenericServerContainer(this,createServerConfig(path),serverGroup,path,keepAlive);
  Activator.getDefault().getContainerManager().addContainer(s,new ContainerTypeDescription("String_Node_Str","String_Node_Str","String_Node_Str"));
  IConnectHandlerPolicy policy=createConnectHandlerPolicy(s,path);
  if (policy != null)   s.setConnectPolicy(policy);
}

Fixed version (ground truth):
protected void createAndInitializeServer(String path,int keepAlive) throws IDCreateException {
  if (path == null || path.equals("String_Node_Str"))   throw new NullPointerException("String_Node_Str");
  GenericServerContainer s=new GenericServerContainer(this,createServerConfig(path),serverGroup,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
  containerManager.addContainer(s,ctd);
  IConnectHandlerPolicy policy=createConnectHandlerPolicy(s,path);
  if (policy != null)   s.setConnectPolicy(policy);
}
Program: 94407
Project: 94407
Buggy source:
private TCPServerSOContainer createServerContainer(String id,TCPServerSOContainerGroup group,String path,int keepAlive) throws IDCreateException {
  final ID newServerID=IDFactory.getDefault().createStringID(id);
  return new TCPServerSOContainer(new SOContainerConfig(newServerID),group,path,keepAlive);
}

Fixed version (ground truth):
private TCPServerSOContainer createServerContainer(String id,TCPServerSOContainerGroup group,String path,int keepAlive) throws IDCreateException {
  final ID newServerID=IDFactory.getDefault().createStringID(id);
  TCPServerSOContainer container=new TCPServerSOContainer(new SOContainerConfig(newServerID),group,path,keepAlive);
  IContainerManager containerManager=Activator.getDefault().getContainerManager();
  ContainerTypeDescription ctd=containerManager.getContainerFactory().getDescriptionByName("String_Node_Str");
  containerManager.addContainer(container,ctd);
  return container;
}
Program: 94408
Project: 94408
Buggy source:
RoomInfo(DiscoverInfo info){
  super();
  this.room=info.getFrom();
  this.membersOnly=info.containsFeature("String_Node_Str");
  this.moderated=info.containsFeature("String_Node_Str");
  this.nonanonymous=info.containsFeature("String_Node_Str");
  this.passwordProtected=info.containsFeature("String_Node_Str");
  this.persistent=info.containsFeature("String_Node_Str");
  Form form=Form.getFormFrom(info);
  if (form != null) {
    this.description=(String)form.getField("String_Node_Str").getValues().next();
    this.subject=(String)form.getField("String_Node_Str").getValues().next();
    this.occupantsCount=Integer.parseInt((String)form.getField("String_Node_Str").getValues().next());
  }
}

Fixed version (ground truth):
RoomInfo(DiscoverInfo info){
  super();
  this.room=info.getFrom();
  this.membersOnly=info.containsFeature("String_Node_Str");
  this.moderated=info.containsFeature("String_Node_Str");
  this.nonanonymous=info.containsFeature("String_Node_Str");
  this.passwordProtected=info.containsFeature("String_Node_Str");
  this.persistent=info.containsFeature("String_Node_Str");
  Form form=Form.getFormFrom(info);
  if (form != null) {
    FormField formField=form.getField("String_Node_Str");
    this.description=(String)((formField == null) ? null : formField.getValues().next());
    formField=form.getField("String_Node_Str");
    this.subject=(String)((formField == null) ? null : formField.getValues().next());
    formField=form.getField("String_Node_Str");
    this.occupantsCount=(formField == null) ? 0 : Integer.parseInt((String)formField.getValues().next());
  }
}
Program: 94409
Project: 94409
Buggy source:
/** 
 * call the service synchronously.
 * @param call the call object.
 * @return the result or <code>null</code>
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callSync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public Object callSync(final IRemoteCall call) throws ECFException {
  final Class[] formalParams=new Class[call.getParameters().length];
  for (int i=0; i < formalParams.length; i++) {
    formalParams[i]=call.getParameters()[i].getClass();
  }
  try {
    return service.getClass().getMethod(call.getMethod(),formalParams).invoke(service,call.getParameters());
  }
 catch (  Throwable t) {
    throw new ECFException("String_Node_Str",t);
  }
}

Fixed version (ground truth):
/** 
 * call the service synchronously.
 * @param call the call object.
 * @return the result or <code>null</code>
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callSync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public Object callSync(final IRemoteCall call) throws ECFException {
  final Class[] formalParams=new Class[call.getParameters().length];
  for (int i=0; i < formalParams.length; i++) {
    formalParams[i]=call.getParameters()[i].getClass();
  }
  IExecutor executor=new ThreadsExecutor();
  IFuture future=executor.execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      return service.getClass().getMethod(call.getMethod(),formalParams).invoke(service,call.getParameters());
    }
  }
,null);
  Object result=null;
  try {
    result=future.get(call.getTimeout());
  }
 catch (  OperationCanceledException e) {
    throw new ECFException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    return null;
  }
catch (  TimeoutException e) {
    throw new ECFException(NLS.bind("String_Node_Str",Long.toString(call.getTimeout())),new TimeoutException(call.getTimeout()));
  }
  return result;
}
Program: 94410
Project: 94410
Buggy source:
/** 
 * Initialization method called by Activator.
 */
public void init(){
  log(LogService.LOG_DEBUG,"String_Node_Str");
  bt=new BundleTracker(context,36,new BundleTrackerImpl(this));
  bt.open();
  discoTrackerCustomizer=new DSTTracker(context);
  discoTracker=new ServiceTracker(context,DiscoveredServiceTracker.class.getName(),discoTrackerCustomizer);
  discoTracker.open();
  spTracker=new ServiceTracker(context,ServicePublication.class.getName(),new ServicePublicationTracker(context,this));
  spTracker.open();
}

Fixed version (ground truth):
/** 
 * Initialization method called by Activator.
 */
public void init(){
  log(LogService.LOG_DEBUG,"String_Node_Str");
  discoTrackerCustomizer=new DSTTracker(context);
  discoTracker=new ServiceTracker(context,DiscoveredServiceTracker.class.getName(),discoTrackerCustomizer);
  discoTracker.open();
  spTracker=new ServiceTracker(context,ServicePublication.class.getName(),new ServicePublicationTracker(context,this));
  spTracker.open();
  bt=new BundleTracker(context,36,new BundleTrackerImpl(this));
  bt.open();
}
Program: 94411
Project: 94411
Buggy source:
/** 
 * the method is called when the R-OSGi bundle is about to be stopped. removes all registered proxy bundles.
 */
void cleanup(){
  final ChannelEndpoint[] c=(ChannelEndpoint[])channels.values().toArray(new ChannelEndpoint[channels.size()]);
  channels.clear();
  for (int i=0; i < c.length; i++) {
    c[i].dispose();
  }
  final Object[] factories=networkChannelFactoryTracker.getServices();
  for (int i=0; i < factories.length; i++) {
    try {
      ((NetworkChannelFactory)factories[i]).deactivate(this);
    }
 catch (    final IOException ioe) {
      if (log != null) {
        log.log(LogService.LOG_ERROR,ioe.getMessage(),ioe);
      }
    }
  }
  eventAdminTracker.close();
  remoteServiceTracker.close();
  serviceDiscoveryHandlerTracker.close();
  remoteServiceListenerTracker.close();
  networkChannelFactoryTracker.close();
}

Fixed version (ground truth):
/** 
 * the method is called when the R-OSGi bundle is about to be stopped. removes all registered proxy bundles.
 */
void cleanup(){
  final ChannelEndpoint[] c=(ChannelEndpoint[])channels.values().toArray(new ChannelEndpoint[channels.size()]);
  channels.clear();
  for (int i=0; i < c.length; i++) {
    c[i].dispose();
  }
  final Object[] factories=networkChannelFactoryTracker.getServices();
  if (factories != null) {
    for (int i=0; i < factories.length; i++) {
      try {
        ((NetworkChannelFactory)factories[i]).deactivate(this);
      }
 catch (      final IOException ioe) {
        if (log != null) {
          log.log(LogService.LOG_ERROR,ioe.getMessage(),ioe);
        }
      }
    }
  }
  eventAdminTracker.close();
  remoteServiceTracker.close();
  serviceDiscoveryHandlerTracker.close();
  remoteServiceListenerTracker.close();
  networkChannelFactoryTracker.close();
}
Program: 94412
Project: 94412
Buggy source:
/** 
 * call the service synchronously.
 * @param call the call object.
 * @return the result or <code>null</code>
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callSync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public Object callSync(final IRemoteCall call) throws ECFException {
  final Class[] formalParams=new Class[call.getParameters().length];
  for (int i=0; i < formalParams.length; i++) {
    formalParams[i]=call.getParameters()[i].getClass();
  }
  IExecutor executor=new ThreadsExecutor();
  IFuture future=executor.execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      return service.getClass().getMethod(call.getMethod(),formalParams).invoke(service,call.getParameters());
    }
  }
,null);
  Object result=null;
  try {
    result=future.get(call.getTimeout());
  }
 catch (  OperationCanceledException e) {
    throw new ECFException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    return null;
  }
catch (  TimeoutException e) {
    throw new ECFException(NLS.bind("String_Node_Str",Long.toString(call.getTimeout())),new TimeoutException(call.getTimeout()));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * call the service synchronously.
 * @param call the call object.
 * @return the result or <code>null</code>
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callSync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public Object callSync(final IRemoteCall call) throws ECFException {
  final Class[] formalParams=new Class[call.getParameters().length];
  for (int i=0; i < formalParams.length; i++) {
    formalParams[i]=call.getParameters()[i].getClass();
  }
  IExecutor executor=new ThreadsExecutor();
  IFuture future=executor.execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      return service.getClass().getMethod(call.getMethod(),formalParams).invoke(service,call.getParameters());
    }
  }
,null);
  Object result=null;
  try {
    result=future.get(call.getTimeout());
  }
 catch (  OperationCanceledException e) {
    throw new ECFException("String_Node_Str",e);
  }
catch (  InterruptedException e) {
    return null;
  }
catch (  TimeoutException e) {
    throw new ECFException(NLS.bind("String_Node_Str",Long.toString(call.getTimeout())),new TimeoutException(call.getTimeout()));
  }
  IStatus status=future.getStatus();
  if (!status.isOK())   throw new ECFException("String_Node_Str",status.getException());
  return result;
}
Program: 94414
Project: 94414
Buggy source:
private boolean removeDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.remove(new DiscoveredServiceID(desc.getServiceID().getLocation(),desc.getRemoteServiceId()));
  }
}

Fixed version (ground truth):
private boolean removeDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.remove(desc);
  }
}
Program: 94415
Project: 94415
Buggy source:
private boolean addDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.add(new DiscoveredServiceID(desc.getServiceID().getLocation(),desc.getRemoteServiceId()));
  }
}

Fixed version (ground truth):
private boolean addDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.add(desc);
  }
}
Program: 94416
Project: 94416
Buggy source:
private boolean findProxyServiceRegistration(ServiceEndpointDescription 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 (sed.equals(reg.getServiceEndpointDescription()))     return true;
  }
  return false;
}
Program: 94417
Project: 94417
Buggy source:
private boolean containsDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.contains(new DiscoveredServiceID(desc.getServiceID().getLocation(),desc.getRemoteServiceId()));
  }
}

Fixed version (ground truth):
private boolean containsDiscoveredServiceID(RemoteServiceEndpointDescription desc){
synchronized (serviceLocations) {
    return serviceLocations.contains(desc);
  }
}
Program: 94418
Project: 94418
Buggy source:
public RemoteServiceEndpointDescriptionImpl(IServiceInfo serviceInfo){
  super(((ServiceProperties)serviceInfo.getServiceProperties()).asProperties());
  this.serviceId=serviceInfo.getServiceID();
  IServiceProperties serviceProperties=serviceInfo.getServiceProperties();
  final byte[] endpointBytes=serviceProperties.getPropertyBytes(RemoteServicePublication.ENDPOINT_CONTAINERID);
  if (endpointBytes == null)   throw new IDCreateException("String_Node_Str");
  final String endpointStr=new String(endpointBytes);
  final String namespaceStr=serviceProperties.getPropertyString(RemoteServicePublication.ENDPOINT_CONTAINERID_NAMESPACE);
  if (namespaceStr == null) {
    throw new IDCreateException("String_Node_Str");
  }
  endpointId=IDFactory.getDefault().createID(namespaceStr,endpointStr);
  final byte[] targetBytes=serviceProperties.getPropertyBytes(RemoteServicePublication.TARGET_CONTAINERID);
  if (targetBytes != null) {
    final String targetStr=new String(endpointBytes);
    String targetNamespaceStr=serviceProperties.getPropertyString(RemoteServicePublication.TARGET_CONTAINERID_NAMESPACE);
    if (targetNamespaceStr == null)     targetNamespaceStr=namespaceStr;
    targetId=IDFactory.getDefault().createID(targetNamespaceStr,targetStr);
  }
}

Fixed version (ground truth):
public RemoteServiceEndpointDescriptionImpl(IServiceInfo serviceInfo){
  super(((ServiceProperties)serviceInfo.getServiceProperties()).asProperties());
  this.serviceId=serviceInfo.getServiceID();
  IServiceProperties serviceProperties=serviceInfo.getServiceProperties();
  final byte[] endpointBytes=serviceProperties.getPropertyBytes(RemoteServicePublication.ENDPOINT_CONTAINERID);
  if (endpointBytes == null)   throw new IDCreateException("String_Node_Str");
  final String endpointStr=new String(endpointBytes);
  final String namespaceStr=serviceProperties.getPropertyString(RemoteServicePublication.ENDPOINT_CONTAINERID_NAMESPACE);
  if (namespaceStr == null) {
    throw new IDCreateException("String_Node_Str");
  }
  endpointId=IDFactory.getDefault().createID(namespaceStr,endpointStr);
  final byte[] targetBytes=serviceProperties.getPropertyBytes(RemoteServicePublication.TARGET_CONTAINERID);
  if (targetBytes != null) {
    final String targetStr=new String(endpointBytes);
    String targetNamespaceStr=serviceProperties.getPropertyString(RemoteServicePublication.TARGET_CONTAINERID_NAMESPACE);
    if (targetNamespaceStr == null)     targetNamespaceStr=namespaceStr;
    targetId=IDFactory.getDefault().createID(targetNamespaceStr,targetStr);
  }
  URI serviceLocation=this.serviceId.getLocation();
  long rsId=this.getRemoteServiceId();
  hashCode=31 * hashCode + (int)(rsId ^ (rsId >>> 32));
  hashCode=31 * hashCode + serviceLocation.hashCode();
}
Program: 94419
Project: 94419
Buggy source:
public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((serviceId == null) ? 0 : serviceId.hashCode());
  return result;
}

Fixed version (ground truth):
public int hashCode(){
  return hashCode;
}
Program: 94420
Project: 94420
Buggy source:
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  RemoteServiceEndpointDescriptionImpl other=(RemoteServiceEndpointDescriptionImpl)obj;
  if (serviceId == null) {
    if (other.serviceId != null)     return false;
  }
 else   if (!serviceId.equals(other.serviceId))   return false;
  return true;
}

Fixed version (ground truth):
public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (getClass() != obj.getClass())   return false;
  RemoteServiceEndpointDescriptionImpl other=(RemoteServiceEndpointDescriptionImpl)obj;
  return this.serviceId.getLocation().equals(other.serviceId.getLocation()) && getRemoteServiceId() == other.getRemoteServiceId();
}
Program: 94421
Project: 94421
Buggy source:
public String toString(){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append("String_Node_Str").append(getProvidedInterfaces());
  sb.append("String_Node_Str").append(getLocation());
  sb.append("String_Node_Str").append(getServiceID());
  sb.append("String_Node_Str").append(getEndpointID());
  sb.append("String_Node_Str").append(getEndpointAsID());
  sb.append("String_Node_Str").append(getConnectTargetID());
  sb.append("String_Node_Str").append(getRemoteServicesFilter());
  sb.append("String_Node_Str").append(getProperties()).append("String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuffer sb=new StringBuffer("String_Node_Str");
  sb.append("String_Node_Str").append(getProvidedInterfaces());
  sb.append("String_Node_Str").append(getLocation());
  sb.append("String_Node_Str").append(getRemoteServiceId());
  sb.append("String_Node_Str").append(getServiceID());
  sb.append("String_Node_Str").append(getEndpointID());
  sb.append("String_Node_Str").append(getEndpointAsID());
  sb.append("String_Node_Str").append(getConnectTargetID());
  sb.append("String_Node_Str").append(getRemoteServicesFilter());
  sb.append("String_Node_Str").append(getProperties()).append("String_Node_Str");
  return sb.toString();
}
Program: 94422
Project: 94422
Buggy source:
/** 
 * @param s
 * @throws SocketException not thrown by this implementation.
 */
private void setSocket(Socket s) throws SocketException {
  socket=s;
  if (s != null)   addressPort=s.getLocalPort() + "String_Node_Str" + s.getInetAddress().getHostName()+ "String_Node_Str"+ s.getPort();
 else   addressPort="String_Node_Str";
}

Fixed version (ground truth):
/** 
 * @param s
 * @throws SocketException not thrown by this implementation.
 */
private void setSocket(Socket s) throws SocketException {
  socket=s;
  if (s != null)   addressPort=s.getLocalPort() + "String_Node_Str" + getHostNameForAddressWithoutLookup(s.getInetAddress())+ "String_Node_Str"+ s.getPort();
 else   addressPort="String_Node_Str";
}
Program: 94423
Project: 94423
Buggy source:
public synchronized ID getLocalID(){
  if (containerID != null)   return containerID;
  if (socket == null)   return null;
  ID retID=null;
  try {
    retID=IDFactory.getDefault().createStringID(PROTOCOL + "String_Node_Str" + socket.getLocalAddress().getHostName()+ "String_Node_Str"+ socket.getLocalPort());
  }
 catch (  final Exception e) {
    traceStack("String_Node_Str",e);
    return null;
  }
  return retID;
}

Fixed version (ground truth):
public synchronized ID getLocalID(){
  if (containerID != null)   return containerID;
  if (socket == null)   return null;
  ID retID=null;
  try {
    retID=IDFactory.getDefault().createStringID(PROTOCOL + "String_Node_Str" + getHostNameForAddressWithoutLookup(socket.getLocalAddress())+ "String_Node_Str"+ socket.getLocalPort());
  }
 catch (  final Exception e) {
    traceStack("String_Node_Str",e);
    return null;
  }
  return retID;
}
Program: 94424
Project: 94424
Buggy source:
public SharedObjectTypeDescription getDescriptionByName(String name) throws SharedObjectCreateException {
  trace("String_Node_Str" + name + "String_Node_Str");
  SharedObjectTypeDescription res=getDescription0(name);
  if (res == null) {
    throw new SharedObjectCreateException(Messages.SharedObjectFactory_Exception_Create_Shared_Object + name + Messages.SharedObjectFactory_Exception_Create_Shared_Object_Not_Found);
  }
  return res;
}

Fixed version (ground truth):
public SharedObjectTypeDescription getDescriptionByName(String name) throws SharedObjectCreateException {
  trace("String_Node_Str" + name + "String_Node_Str");
  SharedObjectTypeDescription res=getDescription0(name);
  if (res == null) {
    throw new SharedObjectCreateException(Messages.bind(Messages.SharedObjectFactory_SharedObjectCreateException_X_Not_Found,name));
  }
  return res;
}
Program: 94425
Project: 94425
Buggy source:
public void waitToCommit() throws SharedObjectAddAbortException {
  if (getTransactionState() == ISharedObjectContainerTransaction.COMMITTED)   return;
synchronized (lock) {
    long end=System.currentTimeMillis() + getTimeout();
    try {
      while (!isVotingCompleted()) {
        long wait=end - System.currentTimeMillis();
        trace("String_Node_Str" + wait + "String_Node_Str"+ getSharedObject().getID());
        if (wait <= 0L)         throw new SharedObjectAddAbortException(Messages.TwoPhaseCommitEventProcessor_Exception_Commit_Timeout + getSharedObject().getID() + Messages.TwoPhaseCommitEventProcessor_Exception_Timeout_Adding_To+ getHomeID(),(Throwable)null,getTimeout());
        lock.wait(wait);
      }
    }
 catch (    Exception except) {
      doTMAbort(except);
    }
    doTMCommit();
  }
}

Fixed version (ground truth):
public void waitToCommit() throws SharedObjectAddAbortException {
  if (getTransactionState() == ISharedObjectContainerTransaction.COMMITTED)   return;
synchronized (lock) {
    long end=System.currentTimeMillis() + getTimeout();
    try {
      while (!isVotingCompleted()) {
        long wait=end - System.currentTimeMillis();
        trace("String_Node_Str" + wait + "String_Node_Str"+ getSharedObject().getID());
        if (wait <= 0L)         throw new SharedObjectAddAbortException(Messages.bind(Messages.TwoPhaseCommitEventProcessor_Exception_Commit_Timeout,new Object[]{getSharedObject().getID(),getHomeID()}),(Throwable)null,getTimeout());
        lock.wait(wait);
      }
    }
 catch (    Exception except) {
      doTMAbort(except);
    }
    doTMCommit();
  }
}
Program: 94426
Project: 94426
Buggy source:
public void removePresenceListener(IPresenceListener listener){
synchronized (presenceListeners) {
    presenceListeners.add(listener);
  }
}

Fixed version (ground truth):
public void removePresenceListener(IPresenceListener listener){
synchronized (presenceListeners) {
    presenceListeners.remove(listener);
  }
}