nus-yam/ex-repair huggingface dataset:
Program: 94266
Project: 94266
Buggy source:
protected void disconnect(Throwable exception){
synchronized (getConnectLock()) {
    if (isConnected()) {
      final ID groupID=getConnectedID();
      if (exception == null)       fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (connection) {
        try {
          connection.sendSynch(groupID,serialize(ContainerMessage.createLeaveGroupMessage(getID(),groupID,getNextSequenceNumber(),getLeaveData(groupID))));
        }
 catch (        final Exception e) {
          ProviderPlugin.getDefault().log(new Status(IStatus.ERROR,ProviderPlugin.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
        }
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,connection);
        }
      }
      if (exception == null)       fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
 else       fireContainerEvent(new ContainerEjectedEvent(this.getID(),groupID,exception));
    }
  }
}

Fixed version (ground truth):
protected void disconnect(Throwable exception){
synchronized (getConnectLock()) {
    if (isConnected()) {
      final ID groupID=getConnectedID();
      if (exception == null)       fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (connection) {
        try {
          connection.sendSynch(groupID,serialize(ContainerMessage.createLeaveGroupMessage(getID(),groupID,getNextSequenceNumber(),getLeaveData(groupID))));
        }
 catch (        final Exception e) {
          ProviderPlugin.getDefault().log(new Status(IStatus.WARNING,ProviderPlugin.PLUGIN_ID,IStatus.WARNING,"String_Node_Str",e));
        }
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,connection);
        }
      }
      if (exception == null)       fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
 else       fireContainerEvent(new ContainerEjectedEvent(this.getID(),groupID,exception));
    }
  }
}
Program: 94267
Project: 94267
Buggy source:
protected void tearDown() throws Exception {
  retrieveAdapter=null;
  startConnectEvents=null;
  startEvents=null;
  dataEvents=null;
  doneEvents=null;
  super.tearDown();
}

Fixed version (ground truth):
protected void tearDown() throws Exception {
  retrieveAdapter=null;
  super.tearDown();
}
Program: 94269
Project: 94269
Buggy source:
public Client(ISynchAsynchEventHandler handler,int maxmsgs){
  if (handler == null)   throw new NullPointerException("String_Node_Str");
  this.handler=handler;
  containerID=handler.getEventHandlerID();
  maxMsg=maxmsgs;
  this.properties=new HashMap();
}

Fixed version (ground truth):
public Client(ISynchAsynchEventHandler handler,int keepAlive){
  if (handler == null)   throw new NullPointerException("String_Node_Str");
  this.handler=handler;
  this.keepAlive=keepAlive;
  containerID=handler.getEventHandlerID();
  this.properties=new HashMap();
}
Program: 94270
Project: 94270
Buggy source:
public synchronized Object connect(ID remote,Object data,int timeout) throws ECFException {
  debug("String_Node_Str" + remote + "String_Node_Str"+ data+ "String_Node_Str"+ timeout+ "String_Node_Str");
  if (socket != null)   throw new ECFException("String_Node_Str");
  URI anURI=null;
  try {
    anURI=new URI(remote.getName());
  }
 catch (  final URISyntaxException e) {
    throw new ECFException("String_Node_Str" + remote,e);
  }
  SocketFactory fact=SocketFactory.getSocketFactory();
  if (fact == null)   fact=SocketFactory.getDefaultSocketFactory();
  ConnectResultMessage res=null;
  try {
    keepAlive=timeout;
    final Socket s=fact.createSocket(anURI.getHost(),anURI.getPort(),keepAlive);
    setSocketOptions(s);
    setSocket(s);
    outputStream=new ObjectOutputStream(s.getOutputStream());
    outputStream.flush();
    inputStream=new ObjectInputStream(s.getInputStream());
    debug("String_Node_Str" + anURI);
    send(new ConnectRequestMessage(anURI,(Serializable)data));
    res=(ConnectResultMessage)readObject();
  }
 catch (  final Exception e) {
    throw new ECFException("String_Node_Str" + remote.getName(),e);
  }
  debug("String_Node_Str" + res);
  setupThreads();
  final Object ret=res.getData();
  debug("String_Node_Str" + ret);
  return ret;
}

Fixed version (ground truth):
public synchronized Object connect(ID remote,Object data,int timeout) throws ECFException {
  debug("String_Node_Str" + remote + "String_Node_Str"+ data+ "String_Node_Str"+ timeout+ "String_Node_Str");
  if (socket != null)   throw new ECFException("String_Node_Str");
  URI anURI=null;
  try {
    anURI=new URI(remote.getName());
  }
 catch (  final URISyntaxException e) {
    throw new ECFException("String_Node_Str" + remote,e);
  }
  SocketFactory fact=SocketFactory.getSocketFactory();
  if (fact == null)   fact=SocketFactory.getDefaultSocketFactory();
  ConnectResultMessage res=null;
  try {
    final Socket s=fact.createSocket(anURI.getHost(),anURI.getPort(),timeout);
    setSocketOptions(s);
    setSocket(s);
    outputStream=new ObjectOutputStream(s.getOutputStream());
    outputStream.flush();
    inputStream=new ObjectInputStream(s.getInputStream());
    debug("String_Node_Str" + anURI);
    send(new ConnectRequestMessage(anURI,(Serializable)data));
    res=(ConnectResultMessage)readObject();
  }
 catch (  final Exception e) {
    throw new ECFException("String_Node_Str" + remote.getName(),e);
  }
  debug("String_Node_Str" + res);
  setupThreads();
  final Object ret=res.getData();
  debug("String_Node_Str" + ret);
  return ret;
}
Program: 94271
Project: 94271
Buggy source:
public void addRemoteServiceListener(IRemoteServiceListener listener){
  remoteServiceListeners.add(listener);
}

Fixed version (ground truth):
public void addRemoteServiceListener(IRemoteServiceListener listener){
synchronized (remoteServiceListeners) {
    remoteServiceListeners.add(listener);
  }
}
Program: 94272
Project: 94272
Buggy source:
public void removeRemoteServiceListener(IRemoteServiceListener listener){
  remoteServiceListeners.remove(listener);
}

Fixed version (ground truth):
public void removeRemoteServiceListener(IRemoteServiceListener listener){
synchronized (remoteServiceListeners) {
    remoteServiceListeners.remove(listener);
  }
}
Program: 94273
Project: 94273
Buggy source:
public void dispose(){
  disconnect();
  remoteServiceListeners.clear();
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  disconnect();
synchronized (remoteServiceListeners) {
    remoteServiceListeners.clear();
  }
  super.dispose();
}
Program: 94274
Project: 94274
Buggy source:
public void start() throws Exception {
  Properties props=new Properties();
  props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,getEndpointListenerScope());
  endpointListenerRegistration=getContext().registerService(EndpointListener.class.getName(),this,(Dictionary)props);
  eventHookRegistration=getContext().registerService(EventHook.class.getName(),this,null);
}

Fixed version (ground truth):
public void start() throws Exception {
  if (exportRegisteredSvcs)   exportRegisteredServices(exportRegisteredSvcsClassname,exportRegisteredSvcsFilter);
  Properties props=new Properties();
  props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,getEndpointListenerScope());
  endpointListenerRegistration=getContext().registerService(EndpointListener.class.getName(),this,(Dictionary)props);
  eventHookRegistration=getContext().registerService(EventHook.class.getName(),this,null);
}
Program: 94275
Project: 94275
Buggy source:
/** 
 * Called when the OSGi framework stops the bundle.
 * @param bc the bundle context.
 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
 */
public void stop(final BundleContext bc) throws Exception {
  r_osgi_tracker.close();
  r_osgi_tracker=null;
  this.context=null;
  plugin=null;
}

Fixed version (ground truth):
/** 
 * Called when the OSGi framework stops the bundle.
 * @param bc the bundle context.
 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
 */
public void stop(final BundleContext bc) throws Exception {
  r_osgi_tracker.close();
  r_osgi_tracker=null;
synchronized (executorServiceTrackerLock) {
    if (executorServiceTracker != null) {
      executorServiceTracker.close();
      executorServiceTracker=null;
    }
  }
  this.context=null;
  plugin=null;
}
Program: 94276
Project: 94276
Buggy source:
/** 
 * call the service asynchronously.
 * @param call the call object.
 * @return the result proxy.
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callAsync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public IFuture callAsync(final IRemoteCall call){
  final AbstractExecutor executor=new ThreadsExecutor();
  return executor.execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      return callSync(call);
    }
  }
,null);
}

Fixed version (ground truth):
/** 
 * call the service asynchronously.
 * @param call the call object.
 * @return the result proxy.
 * @see org.eclipse.ecf.remoteservice.IRemoteService#callAsync(org.eclipse.ecf.remoteservice.IRemoteCall)
 */
public IFuture callAsync(final IRemoteCall call){
  return getAsyncExecutor().execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      return callSync(call);
    }
  }
,null);
}
Program: 94277
Project: 94277
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 {
  Object[] ps=call.getParameters();
  final Object[] parameters=(ps == null) ? EMPTY_ARGS : ps;
  final Class[] formalParams=new Class[parameters.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 {
      final Method method=ClassUtil.getMethod(service.getClass(),call.getMethod(),formalParams);
      return method.invoke(service,parameters);
    }
  }
,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("String_Node_Str" + Long.toString(call.getTimeout()) + "String_Node_Str",new TimeoutException(call.getTimeout()));
  }
  IStatus status=future.getStatus();
  if (!status.isOK())   throw new ECFException("String_Node_Str",status.getException());
  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 {
  Object[] ps=call.getParameters();
  final Object[] parameters=(ps == null) ? EMPTY_ARGS : ps;
  final Class[] formalParams=new Class[parameters.length];
  for (int i=0; i < formalParams.length; i++) {
    formalParams[i]=call.getParameters()[i].getClass();
  }
  IFuture future=getSyncExecutor().execute(new IProgressRunnable(){
    public Object run(    IProgressMonitor monitor) throws Exception {
      final Method method=ClassUtil.getMethod(service.getClass(),call.getMethod(),formalParams);
      return method.invoke(service,parameters);
    }
  }
,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("String_Node_Str" + Long.toString(call.getTimeout()) + "String_Node_Str",new TimeoutException(call.getTimeout()));
  }
  IStatus status=future.getStatus();
  if (!status.isOK())   throw new ECFException("String_Node_Str",status.getException());
  return result;
}
Program: 94279
Project: 94279
Buggy source:
public static String[] getExportedInterfaces(ServiceReference serviceReference){
  Object propValue=serviceReference.getProperty(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_INTERFACES);
  if (propValue == null)   return null;
  boolean wildcard=propValue.equals("String_Node_Str");
  if (wildcard)   return (String[])serviceReference.getProperty(org.osgi.framework.Constants.OBJECTCLASS);
 else {
    final String[] stringValue=getStringArrayFromPropertyValue(propValue);
    if (stringValue != null && stringValue.length == 1 && stringValue[0].equals("String_Node_Str")) {
      LogUtility.logWarning("String_Node_Str",DebugOptions.TOPOLOGY_MANAGER,PropertiesUtil.class,"String_Node_Str");
    }
    return stringValue;
  }
}

Fixed version (ground truth):
public static String[] getExportedInterfaces(ServiceReference serviceReference){
  return getExportedInterfaces(serviceReference,serviceReference.getProperty(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_EXPORTED_INTERFACES));
}
Program: 94280
Project: 94280
Buggy source:
public void start() throws Exception {
  Properties props=new Properties();
  props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,"String_Node_Str" + org.osgi.service.remoteserviceadmin.RemoteConstants.ENDPOINT_ID + "String_Node_Str");
  endpointListenerRegistration=getContext().registerService(EndpointListener.class.getName(),this,(Dictionary)props);
  eventHookRegistration=getContext().registerService(EventHook.class.getName(),this,null);
}

Fixed version (ground truth):
public void start() throws Exception {
  Properties props=new Properties();
  props.put(org.osgi.service.remoteserviceadmin.EndpointListener.ENDPOINT_LISTENER_SCOPE,getEndpointListenerScope());
  endpointListenerRegistration=getContext().registerService(EndpointListener.class.getName(),this,(Dictionary)props);
  eventHookRegistration=getContext().registerService(EventHook.class.getName(),this,null);
}
Program: 94281
Project: 94281
Buggy source:
private BundleContext getProxyServiceFactoryContext(EndpointDescription endpointDescription){
  Activator a=Activator.getDefault();
  if (a == null)   return null;
  if (a.isOldEquinox()) {
    BundleContext rsaContext=Activator.getContext();
    if (rsaContext == null)     return null;
    List<String> interfaces=endpointDescription.getInterfaces();
    Collection<Class> serviceInterfaceClasses=loadServiceInterfacesViaBundle(rsaContext.getBundle(),interfaces.toArray(new String[interfaces.size()]));
    if (serviceInterfaceClasses.size() == 0)     return null;
    PackageAdmin packageAdmin=getPackageAdmin();
    if (packageAdmin == null)     return null;
    Bundle bundle=packageAdmin.getBundle(serviceInterfaceClasses.iterator().next());
    if (bundle == null)     return null;
    return bundle.getBundleContext();
  }
 else   return a.getProxyServiceFactoryBundleContext();
}

Fixed version (ground truth):
private BundleContext getProxyServiceFactoryContext(EndpointDescription endpointDescription){
  Activator a=Activator.getDefault();
  if (a == null)   return null;
  if (a.isOldEquinox()) {
    BundleContext rsaContext=Activator.getContext();
    if (rsaContext == null)     return null;
    List<String> interfaces=endpointDescription.getInterfaces();
    Collection<Class> serviceInterfaceClasses=loadServiceInterfacesViaBundle(rsaContext.getBundle(),interfaces.toArray(new String[interfaces.size()]));
    if (serviceInterfaceClasses.size() == 0)     return null;
    PackageAdmin packageAdmin=getPackageAdmin();
    if (packageAdmin == null)     return null;
    Bundle bundle=packageAdmin.getBundle(serviceInterfaceClasses.iterator().next());
    if (bundle == null)     return null;
    if (bundle.getState() == Bundle.RESOLVED) {
      try {
        bundle.start();
      }
 catch (      BundleException e) {
        logError("String_Node_Str","String_Node_Str" + bundle.getSymbolicName() + "String_Node_Str"+ interfaces);
        return null;
      }
    }
    return bundle.getBundleContext();
  }
  return a.getProxyServiceFactoryBundleContext();
}
Program: 94282
Project: 94282
Buggy source:
/** 
 * Parse the attributes of an element, given the list of required and optional ones. Return values in same order, null for those not present. Log warnings for extra attributes or missing required attributes.
 */
protected String[] parseAttributes(Attributes attributes,String[] required,String[] optional){
  String[] result=new String[required.length + optional.length];
  for (int i=0; i < attributes.getLength(); i+=1) {
    String name=attributes.getLocalName(i);
    String value=attributes.getValue(i).trim();
    int j;
    if ((j=indexOf(required,name)) >= 0) {
      result[j]=value;
    }
 else     if ((j=indexOf(optional,name)) >= 0) {
      result[required.length + j]=value;
    }
 else {
      unexpectedAttribute(elementHandled,name,value);
    }
  }
  for (int i=0; i < required.length; i+=1) {
    checkRequiredAttribute(elementHandled,required[i],result[i]);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Parse the attributes of an element, given the list of required and optional ones. Return values in same order, null for those not present. Log warnings for extra attributes or missing required attributes.
 */
protected String[] parseAttributes(Attributes attributes,String[] required,String[] optional){
  String[] result=new String[required.length + optional.length];
  for (int i=0; i < attributes.getLength(); i+=1) {
    String name=attributes.getLocalName(i);
    String value=attributes.getValue(i).trim();
    int j;
    if ((j=indexOf(required,name)) >= 0)     result[j]=value;
 else     if ((j=indexOf(optional,name)) >= 0)     result[required.length + j]=value;
 else     unexpectedAttribute(elementHandled,name,value);
  }
  for (int i=0; i < required.length; i+=1)   checkRequiredAttribute(elementHandled,required[i],result[i]);
  return result;
}
Program: 94283
Project: 94283
Buggy source:
private boolean isValidProperty(String[] property){
  return (property.length == 2 && property[0] != null && property[1] != null);
}

Fixed version (ground truth):
private boolean isValidProperty(String name,Object value){
  return (name != null && value != null);
}
Program: 94284
Project: 94284
Buggy source:
protected Object[] createEmptyArrayOfType(){
  if (valueType.equals("String_Node_Str")) {
    return new String[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Long[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Double[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Double[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Integer[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Byte[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Character[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Boolean[]{};
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return new Short[]{};
  }
 else   return null;
}

Fixed version (ground truth):
protected Object[] createEmptyArrayOfType(){
  if (valueType.equals("String_Node_Str"))   return new String[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Long[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Double[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Double[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Integer[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Byte[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Character[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Boolean[]{};
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str"))   return new Short[]{};
 else   return null;
}
Program: 94285
Project: 94285
Buggy source:
public EndpointPropertyHandler(ContentHandler parentHandler,Attributes attributes,Map<String,Object> properties) throws SAXException {
  super(parentHandler,ENDPOINT_PROPERTY);
  name=parseRequiredAttributes(attributes,new String[]{ENDPOINT_PROPERTY_NAME})[0];
  value=parseOptionalAttribute(attributes,ENDPOINT_PROPERTY_VALUE);
  String vt=parseOptionalAttribute(attributes,ENDPOINT_PROPERTY_VALUETYPE);
  if (vt != null) {
    if (!multiValueTypes.contains(vt))     throw new SAXException("String_Node_Str" + vt + "String_Node_Str");
    this.valueType=vt;
  }
  this.properties=properties;
  if (value != null) {
    String[] property=new String[]{name,value};
    if (isValidProperty(property)) {
      this.properties.put(property[0],property[1]);
    }
  }
}

Fixed version (ground truth):
public EndpointPropertyHandler(ContentHandler parentHandler,Attributes attributes,Map<String,Object> properties) throws SAXException {
  super(parentHandler,ENDPOINT_PROPERTY);
  name=parseRequiredAttributes(attributes,new String[]{ENDPOINT_PROPERTY_NAME})[0];
  String strValue=parseOptionalAttribute(attributes,ENDPOINT_PROPERTY_VALUE);
  String vt=parseOptionalAttribute(attributes,ENDPOINT_PROPERTY_VALUETYPE);
  if (vt != null) {
    if (!multiValueTypes.contains(vt))     throw new SAXException("String_Node_Str" + vt + "String_Node_Str");
    this.valueType=vt;
  }
  this.properties=properties;
  if (strValue != null) {
    value=createValue(this.valueType,strValue);
    if (isValidProperty(name,value))     this.properties.put(name,value);
  }
}
Program: 94286
Project: 94286
Buggy source:
protected void processCharacters(String data){
  if (data.length() > 0) {
    unexpectedCharacterData(this,data);
  }
}

Fixed version (ground truth):
protected void processCharacters(String data){
  if (data.length() > 0)   unexpectedCharacterData(this,data);
}
Program: 94287
Project: 94287
Buggy source:
SAXParser getParser() throws ParserConfigurationException, SAXException {
  Activator a=Activator.getDefault();
  if (a == null)   return null;
  SAXParserFactory factory=a.getSAXParserFactory();
  if (factory == null) {
    throw new SAXException("String_Node_Str");
  }
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  try {
    factory.setFeature("String_Node_Str",true);
  }
 catch (  SAXException se) {
  }
  SAXParser theParser=factory.newSAXParser();
  if (theParser == null) {
    throw new SAXException("String_Node_Str");
  }
  xmlReader=theParser.getXMLReader();
  return theParser;
}

Fixed version (ground truth):
SAXParser getParser() throws ParserConfigurationException, SAXException {
  Activator a=Activator.getDefault();
  if (a == null)   return null;
  SAXParserFactory factory=a.getSAXParserFactory();
  if (factory == null)   throw new SAXException("String_Node_Str");
  factory.setNamespaceAware(true);
  factory.setValidating(false);
  try {
    factory.setFeature("String_Node_Str",true);
  }
 catch (  SAXException se) {
  }
  SAXParser theParser=factory.newSAXParser();
  if (theParser == null) {
    throw new SAXException("String_Node_Str");
  }
  xmlReader=theParser.getXMLReader();
  return theParser;
}
Program: 94288
Project: 94288
Buggy source:
protected Object createValue(String value){
  if (value == null)   return null;
  if (valueType.equals("String_Node_Str")) {
    return value;
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Long.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Double.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Float.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Integer.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Byte.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    char[] chars=new char[1];
    value.getChars(0,1,chars,0);
    return Character.valueOf(chars[0]);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Boolean.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Short.valueOf(value);
  }
  return null;
}

Fixed version (ground truth):
private Object createValue(String valueType,String value){
  if (value == null)   return null;
  if (valueType.equals("String_Node_Str")) {
    return value;
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Long.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Double.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Float.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Integer.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Byte.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    char[] chars=new char[1];
    value.getChars(0,1,chars,0);
    return Character.valueOf(chars[0]);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Boolean.valueOf(value);
  }
 else   if (valueType.equals("String_Node_Str") || valueType.equals("String_Node_Str")) {
    return Short.valueOf(value);
  }
  return null;
}
Program: 94289
Project: 94289
Buggy source:
public static String makeSimpleName(String localName,String qualifiedName){
  if (localName != null && localName.length() > 0) {
    return localName;
  }
  int nameSpaceIndex=qualifiedName.indexOf("String_Node_Str");
  return (nameSpaceIndex == -1 ? qualifiedName : qualifiedName.substring(nameSpaceIndex + 1));
}

Fixed version (ground truth):
public static String makeSimpleName(String localName,String qualifiedName){
  if (localName != null && localName.length() > 0)   return localName;
  int nameSpaceIndex=qualifiedName.indexOf("String_Node_Str");
  return (nameSpaceIndex == -1 ? qualifiedName : qualifiedName.substring(nameSpaceIndex + 1));
}
Program: 94290
Project: 94290
Buggy source:
public void startElement(String name,Attributes attributes) throws SAXException {
  if (value != null)   throw new SAXException("String_Node_Str");
  if (ENDPOINT_PROPERTY_ARRAY.equals(name)) {
    if (multiValueHandler == null) {
      multiValueHandler=new ArrayMultiValueHandler(this,ENDPOINT_PROPERTY_ARRAY,valueType);
    }
 else {
      duplicateElement(this,name,attributes);
    }
  }
 else   if (ENDPOINT_PROPERTY_LIST.equals(name)) {
    if (multiValueHandler == null) {
      multiValueHandler=new ListMultiValueHandler(this,ENDPOINT_PROPERTY_LIST,valueType);
    }
 else {
      duplicateElement(this,name,attributes);
    }
  }
 else   if (ENDPOINT_PROPERTY_SET.equals(name)) {
    if (multiValueHandler == null) {
      multiValueHandler=new SetMultiValueHandler(this,ENDPOINT_PROPERTY_SET,valueType);
    }
 else {
      duplicateElement(this,name,attributes);
    }
  }
 else   if (ENDPOINT_PROPERTY_XML.equals(name)) {
    if (xmlValueHandler == null) {
      xmlValueHandler=new XMLValueHandler(this);
    }
 else {
      duplicateElement(this,name,attributes);
    }
  }
 else {
    invalidElement(name,attributes);
  }
}

Fixed version (ground truth):
public void startElement(String name,Attributes attributes) throws SAXException {
  if (value != null)   throw new SAXException("String_Node_Str");
  if (ENDPOINT_PROPERTY_ARRAY.equals(name)) {
    if (multiValueHandler == null)     multiValueHandler=new ArrayMultiValueHandler(this,ENDPOINT_PROPERTY_ARRAY,valueType);
 else     duplicateElement(this,name,attributes);
  }
 else   if (ENDPOINT_PROPERTY_LIST.equals(name)) {
    if (multiValueHandler == null)     multiValueHandler=new ListMultiValueHandler(this,ENDPOINT_PROPERTY_LIST,valueType);
 else     duplicateElement(this,name,attributes);
  }
 else   if (ENDPOINT_PROPERTY_SET.equals(name)) {
    if (multiValueHandler == null)     multiValueHandler=new SetMultiValueHandler(this,ENDPOINT_PROPERTY_SET,valueType);
 else     duplicateElement(this,name,attributes);
  }
 else   if (ENDPOINT_PROPERTY_XML.equals(name)) {
    if (xmlValueHandler == null)     xmlValueHandler=new XMLValueHandler(this);
 else     duplicateElement(this,name,attributes);
  }
 else   invalidElement(name,attributes);
}
Program: 94291
Project: 94291
Buggy source:
private boolean allWhiteSpace(StringBuffer sb){
  int length=sb.length();
  for (int i=0; i < length; i+=1) {
    if (!Character.isWhitespace(sb.charAt(i))) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean allWhiteSpace(StringBuffer sb){
  int length=sb.length();
  for (int i=0; i < length; i+=1)   if (!Character.isWhitespace(sb.charAt(i)))   return false;
  return true;
}
Program: 94292
Project: 94292
Buggy source:
/** 
 * @param properties The map from which to create the Endpoint Description. The keys in the map must be type <code>String</code> and, since the keys are case insensitive, there must be no duplicates with case variation.
 * @throws IllegalArgumentException When the properties are not proper for an Endpoint Description.
 * @see org.osgi.service.remoteserviceadmin.EndpointDescription#EndpointDescription(Map)
 */
public EndpointDescription(Map<String,Object> properties){
  super(properties);
  verifyECFProperties();
}

Fixed version (ground truth):
/** 
 * @param properties The map from which to create the Endpoint Description. The keys in the map must be type <code>String</code> and, since the keys are case insensitive, there must be no duplicates with case variation.
 * @throws IllegalArgumentException When the properties are not proper for an Endpoint Description.
 * @see org.osgi.service.remoteserviceadmin.EndpointDescription#EndpointDescription(Map)
 */
public EndpointDescription(Map<String,Object> properties){
  super(properties);
  verifyECFProperties();
  computeHashCode();
}
Program: 94293
Project: 94293
Buggy source:
private String processValue(String characters){
  if (characters == null || characters.length() == 0)   return null;
  if (valueType.equals("String_Node_Str"))   return characters;
  int startIndex=0;
  while (Character.isWhitespace(characters.charAt(startIndex)))   startIndex++;
  int endIndex=characters.length() - 1;
  while (Character.isWhitespace(characters.charAt(endIndex)))   endIndex--;
  return characters.substring(startIndex,endIndex + 1);
}

Fixed version (ground truth):
private String processValue(String characters){
  if (characters == null || characters.length() == 0)   return null;
  if (valueType.equals("String_Node_Str"))   return characters;
  return characters.trim();
}
Program: 94294
Project: 94294
Buggy source:
private IStatus createResultStatus(List<IStatus> statuses,String errorMessage){
  List<IStatus> errorStatuses=new ArrayList<IStatus>();
  for (  IStatus status : statuses)   if (!status.isOK())   errorStatuses.add(status);
  if (errorStatuses.size() > 0)   return new MultiStatus(Activator.PLUGIN_ID,IStatus.ERROR,(IStatus[])statuses.toArray(),errorMessage,null);
 else   return Status.OK_STATUS;
}

Fixed version (ground truth):
private IStatus createResultStatus(List<IStatus> statuses,String errorMessage){
  List<IStatus> errorStatuses=new ArrayList<IStatus>();
  for (  IStatus status : statuses)   if (!status.isOK())   errorStatuses.add(status);
  if (errorStatuses.size() > 0)   return new MultiStatus(Activator.PLUGIN_ID,IStatus.ERROR,(IStatus[])statuses.toArray(new IStatus[statuses.size()]),errorMessage,null);
 else   return Status.OK_STATUS;
}
Program: 94297
Project: 94297
Buggy source:
public IRemoteServiceContainer[] findHostContainers(ServiceReference serviceReference,String[] serviceExportedInterfaces,String[] serviceExportedConfigs,String[] serviceIntents){
  Collection rsContainers=findExistingHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
  if (rsContainers.size() == 0 && autoCreateContainer) {
    rsContainers=createAndConfigureHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
    Object target=serviceReference.getProperty(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_CONNECT_TARGET);
    if (target != null) {
      for (Iterator i=rsContainers.iterator(); i.hasNext(); ) {
        IContainer container=((IRemoteServiceContainer)i.next()).getContainer();
        try {
          connectHostContainer(serviceReference,container,target);
        }
 catch (        Exception e) {
          logException("String_Node_Str" + container.getID() + "String_Node_Str"+ target,e);
        }
      }
    }
  }
  return (IRemoteServiceContainer[])rsContainers.toArray(new IRemoteServiceContainer[]{});
}

Fixed version (ground truth):
public synchronized IRemoteServiceContainer[] findHostContainers(ServiceReference serviceReference,String[] serviceExportedInterfaces,String[] serviceExportedConfigs,String[] serviceIntents){
  Collection rsContainers=findExistingHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
  if (rsContainers.size() == 0 && autoCreateContainer) {
    rsContainers=createAndConfigureHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
    Object target=serviceReference.getProperty(IDistributionConstants.SERVICE_EXPORTED_CONTAINER_CONNECT_TARGET);
    if (target != null) {
      for (Iterator i=rsContainers.iterator(); i.hasNext(); ) {
        IContainer container=((IRemoteServiceContainer)i.next()).getContainer();
        try {
          connectHostContainer(serviceReference,container,target);
        }
 catch (        Exception e) {
          logException("String_Node_Str" + container.getID() + "String_Node_Str"+ target,e);
        }
      }
    }
  }
  return (IRemoteServiceContainer[])rsContainers.toArray(new IRemoteServiceContainer[]{});
}
Program: 94298
Project: 94298
Buggy source:
public IRemoteServiceContainer[] selectHostContainers(ServiceReference serviceReference,String[] serviceExportedInterfaces,String[] serviceExportedConfigs,String[] serviceIntents){
  Collection rsContainers=selectExistingHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
  if (rsContainers.size() == 0 && autoCreateContainer) {
    rsContainers=createAndConfigureHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
    Object target=serviceReference.getProperty(RemoteConstants.ENDPOINT_CONNECTTARGET_ID);
    if (target != null) {
      for (Iterator i=rsContainers.iterator(); i.hasNext(); ) {
        IContainer container=((IRemoteServiceContainer)i.next()).getContainer();
        try {
          connectHostContainer(serviceReference,container,target);
        }
 catch (        Exception e) {
          logException("String_Node_Str" + container.getID() + "String_Node_Str"+ target,e);
        }
      }
    }
  }
  return (IRemoteServiceContainer[])rsContainers.toArray(new IRemoteServiceContainer[]{});
}

Fixed version (ground truth):
public synchronized IRemoteServiceContainer[] selectHostContainers(ServiceReference serviceReference,String[] serviceExportedInterfaces,String[] serviceExportedConfigs,String[] serviceIntents){
  Collection rsContainers=selectExistingHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
  if (rsContainers.size() == 0 && autoCreateContainer) {
    rsContainers=createAndConfigureHostContainers(serviceReference,serviceExportedInterfaces,serviceExportedConfigs,serviceIntents);
    Object target=serviceReference.getProperty(RemoteConstants.ENDPOINT_CONNECTTARGET_ID);
    if (target != null) {
      for (Iterator i=rsContainers.iterator(); i.hasNext(); ) {
        IContainer container=((IRemoteServiceContainer)i.next()).getContainer();
        try {
          connectHostContainer(serviceReference,container,target);
        }
 catch (        Exception e) {
          logException("String_Node_Str" + container.getID() + "String_Node_Str"+ target,e);
        }
      }
    }
  }
  return (IRemoteServiceContainer[])rsContainers.toArray(new IRemoteServiceContainer[]{});
}
Program: 94299
Project: 94299
Buggy source:
private void startRemoteServiceAdmin(){
  Properties rsaProps=new Properties();
  rsaProps.put(RemoteServiceAdmin.SERVICE_PROP,new Boolean(true));
  remoteServiceAdminRegistration=context.registerService(org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class.getName(),new ServiceFactory(){
    public Object getService(    Bundle bundle,    ServiceRegistration registration){
      return new RemoteServiceAdmin(bundle);
    }
    public void ungetService(    Bundle bundle,    ServiceRegistration registration,    Object service){
      if (service != null)       ((RemoteServiceAdmin)service).close();
    }
  }
,rsaProps);
}

Fixed version (ground truth):
private void startRemoteServiceAdmin(){
  Properties rsaProps=new Properties();
  rsaProps.put(RemoteServiceAdmin.SERVICE_PROP,new Boolean(true));
  remoteServiceAdminRegistration=context.registerService(org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class.getName(),new ServiceFactory(){
    public Object getService(    Bundle bundle,    ServiceRegistration registration){
      return new RemoteServiceAdmin(bundle);
    }
    public void ungetService(    Bundle bundle,    ServiceRegistration registration,    Object service){
      if (service != null)       ((RemoteServiceAdmin)service).close();
    }
  }
,(Dictionary)rsaProps);
}
Program: 94301
Project: 94301
Buggy source:
private void setupDefaultContainerSelectors(){
  Properties props=new Properties();
  props.put(org.osgi.framework.Constants.SERVICE_RANKING,new Integer(Integer.MIN_VALUE));
  ServiceReference[] hostContainerSelectorRefs=null;
  try {
    hostContainerSelectorRefs=getContext().getServiceReferences(IHostContainerSelector.class.getName(),null);
  }
 catch (  InvalidSyntaxException e) {
  }
  if (hostContainerSelectorRefs == null || hostContainerSelectorRefs.length == 0) {
    hostContainerSelector=new HostContainerSelector(hostDefaultConfigTypes,hostAutoCreateContainer);
    hostContainerSelectorRegistration=getContext().registerService(IHostContainerSelector.class.getName(),hostContainerSelector,props);
  }
  ServiceReference[] consumerContainerSelectorRefs=null;
  try {
    consumerContainerSelectorRefs=getContext().getServiceReferences(IConsumerContainerSelector.class.getName(),null);
  }
 catch (  InvalidSyntaxException e) {
  }
  if (consumerContainerSelectorRefs == null || consumerContainerSelectorRefs.length == 0) {
    consumerContainerSelector=new ConsumerContainerSelector(consumerAutoCreateContainer);
    consumerContainerSelectorRegistration=getContext().registerService(IConsumerContainerSelector.class.getName(),consumerContainerSelector,props);
  }
}

Fixed version (ground truth):
private void setupDefaultContainerSelectors(){
  Properties props=new Properties();
  props.put(org.osgi.framework.Constants.SERVICE_RANKING,new Integer(Integer.MIN_VALUE));
  ServiceReference[] hostContainerSelectorRefs=null;
  try {
    hostContainerSelectorRefs=getContext().getServiceReferences(IHostContainerSelector.class.getName(),null);
  }
 catch (  InvalidSyntaxException e) {
  }
  if (hostContainerSelectorRefs == null || hostContainerSelectorRefs.length == 0) {
    hostContainerSelector=new HostContainerSelector(hostDefaultConfigTypes,hostAutoCreateContainer);
    hostContainerSelectorRegistration=getContext().registerService(IHostContainerSelector.class.getName(),hostContainerSelector,(Dictionary)props);
  }
  ServiceReference[] consumerContainerSelectorRefs=null;
  try {
    consumerContainerSelectorRefs=getContext().getServiceReferences(IConsumerContainerSelector.class.getName(),null);
  }
 catch (  InvalidSyntaxException e) {
  }
  if (consumerContainerSelectorRefs == null || consumerContainerSelectorRefs.length == 0) {
    consumerContainerSelector=new ConsumerContainerSelector(consumerAutoCreateContainer);
    consumerContainerSelectorRegistration=getContext().registerService(IConsumerContainerSelector.class.getName(),consumerContainerSelector,(Dictionary)props);
  }
}
Program: 94302
Project: 94302
Buggy source:
/** 
 * @since 6.0
 */
@SuppressWarnings("String_Node_Str") public Object getProxy(ClassLoader cl,Class[] interfaces) throws ECFException {
  List classes=new ArrayList();
  for (int i=0; i < interfaces.length; i++) {
    classes.add(interfaces[i]);
    Class asyncClass=findAsyncRemoteServiceProxyClass(cl,interfaces[i]);
    if (asyncClass != null)     classes.add(asyncClass);
  }
  classes.add(IRemoteServiceProxy.class);
  try {
    return createProxy(cl,(Class[])classes.toArray(new Class[classes.size()]));
  }
 catch (  final Exception e) {
    ECFException except=new ECFException("String_Node_Str",e);
    logWarning("String_Node_Str",except);
    throw except;
  }
catch (  final NoClassDefFoundError e) {
    ECFException except=new ECFException("String_Node_Str",e);
    logWarning("String_Node_Str",except);
    throw except;
  }
}

Fixed version (ground truth):
/** 
 * @since 6.0
 */
@SuppressWarnings("String_Node_Str") public Object getProxy(ClassLoader cl,Class[] interfaces) throws ECFException {
  List classes=new ArrayList();
  for (int i=0; i < interfaces.length; i++) {
    classes.add(interfaces[i]);
    Class asyncClass=findAsyncRemoteServiceProxyClass(cl,interfaces[i]);
    if (asyncClass != null)     classes.add(asyncClass);
  }
  addRemoteServiceProxyToProxy(classes);
  try {
    return createProxy(cl,(Class[])classes.toArray(new Class[classes.size()]));
  }
 catch (  final Exception e) {
    ECFException except=new ECFException("String_Node_Str",e);
    logWarning("String_Node_Str",except);
    throw except;
  }
catch (  final NoClassDefFoundError e) {
    ECFException except=new ECFException("String_Node_Str",e);
    logWarning("String_Node_Str",except);
    throw except;
  }
}
Program: 94303
Project: 94303
Buggy source:
public void testGetService() throws Exception {
  final IRemoteService service=registerAndGetRemoteService();
  if (service == null)   return;
  assertNotNull(service);
  Thread.sleep(SLEEPTIME);
}

Fixed version (ground truth):
public void testGetService() throws Exception {
  final IRemoteService service=registerAndGetRemoteService();
  assertNotNull(service);
  Thread.sleep(SLEEPTIME);
}
Program: 94304
Project: 94304
Buggy source:
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  Activator.instance=this;
  Properties rsaProps=new Properties();
  rsaProps.put(RemoteServiceAdmin.SERVICE_PROP,new Boolean(true));
  remoteServiceAdminRegistration=context.registerService(org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class.getName(),new ServiceFactory(){
    public Object getService(    Bundle bundle,    ServiceRegistration registration){
      return new RemoteServiceAdmin(bundle);
    }
    public void ungetService(    Bundle bundle,    ServiceRegistration registration,    Object service){
      if (service != null)       ((RemoteServiceAdmin)service).close();
    }
  }
,(Dictionary)rsaProps);
  final Properties properties=new Properties();
  properties.put(Constants.SERVICE_RANKING,new Integer(Integer.MIN_VALUE));
  endpointDescriptionAdvertiser=new EndpointDescriptionAdvertiser(endpointDescriptionLocator);
  endpointDescriptionAdvertiserRegistration=getContext().registerService(IEndpointDescriptionAdvertiser.class.getName(),endpointDescriptionAdvertiser,(Dictionary)properties);
  endpointDescriptionLocator=new EndpointDescriptionLocator(context);
  basicTopologyManager=new BasicTopologyManager(context);
  basicTopologyManager.start();
  endpointDescriptionLocator.start();
}

Fixed version (ground truth):
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  Activator.instance=this;
  Properties rsaProps=new Properties();
  rsaProps.put(RemoteServiceAdmin.SERVICE_PROP,new Boolean(true));
  remoteServiceAdminRegistration=context.registerService(org.osgi.service.remoteserviceadmin.RemoteServiceAdmin.class.getName(),new ServiceFactory(){
    public Object getService(    Bundle bundle,    ServiceRegistration registration){
      return new RemoteServiceAdmin(bundle);
    }
    public void ungetService(    Bundle bundle,    ServiceRegistration registration,    Object service){
      if (service != null)       ((RemoteServiceAdmin)service).close();
    }
  }
,(Dictionary)rsaProps);
  final Properties properties=new Properties();
  properties.put(Constants.SERVICE_RANKING,new Integer(Integer.MIN_VALUE));
  endpointDescriptionLocator=new EndpointDescriptionLocator(context);
  endpointDescriptionAdvertiser=new EndpointDescriptionAdvertiser(endpointDescriptionLocator);
  endpointDescriptionAdvertiserRegistration=getContext().registerService(IEndpointDescriptionAdvertiser.class.getName(),endpointDescriptionAdvertiser,(Dictionary)properties);
  basicTopologyManager=new BasicTopologyManager(context);
  basicTopologyManager.start();
  endpointDescriptionLocator.start();
}
Program: 94305
Project: 94305
Buggy source:
void handleService(IServiceInfo serviceInfo,boolean discovered){
  IServiceID serviceID=serviceInfo.getServiceID();
  if (matchServiceID(serviceID))   handleOSGiServiceEndpoint(serviceID,serviceInfo,true);
}

Fixed version (ground truth):
void handleService(IServiceInfo serviceInfo,boolean discovered){
  IServiceID serviceID=serviceInfo.getServiceID();
  if (matchServiceID(serviceID))   handleOSGiServiceEndpoint(serviceID,serviceInfo,discovered);
}
Program: 94306
Project: 94306
Buggy source:
public void unpublishService(RemoteServiceRegistrationImpl serviceReg){
  final String[] clazzes=(String[])serviceReg.getReference().getProperty(REMOTEOBJECTCLASS);
  final int size=clazzes.length;
  for (int i=0; i < size; i++) {
    final String clazz=clazzes[i];
    final ArrayList services=(ArrayList)publishedServicesByClass.get(clazz);
    services.remove(serviceReg);
  }
  allPublishedServices.remove(serviceReg);
}

Fixed version (ground truth):
public void unpublishService(RemoteServiceRegistrationImpl serviceReg){
  final String[] clazzes=(String[])serviceReg.getReference().getProperty(REMOTEOBJECTCLASS);
  final int size=clazzes.length;
  for (int i=0; i < size; i++) {
    final String clazz=clazzes[i];
    final ArrayList services=(ArrayList)publishedServicesByClass.get(clazz);
    if (services != null)     services.remove(serviceReg);
  }
  allPublishedServices.remove(serviceReg);
}