nus-yam/ex-repair huggingface dataset:
Program: 47868
Project: 47868
Buggy source:
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  int count=source.size();
  out.writeInt(count);
  if (count > 0) {
    long now=Clock.currentTimeMillis();
    for (    Map.Entry<String,Map<Data,CacheRecord>> entry : source.entrySet()) {
      Map<Data,CacheRecord> cacheMap=entry.getValue();
      int subCount=cacheMap.size();
      out.writeInt(subCount);
      if (subCount > 0) {
        out.writeUTF(entry.getKey());
        for (        Map.Entry<Data,CacheRecord> e : cacheMap.entrySet()) {
          final Data key=e.getKey();
          final CacheRecord record=e.getValue();
          final long expirationTime=record.getExpirationTime();
          if (expirationTime > now) {
            key.writeData(out);
            out.writeObject(record);
          }
          subCount--;
        }
        if (subCount != 0) {
          throw new AssertionError("String_Node_Str" + subCount);
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void writeInternal(ObjectDataOutput out) throws IOException {
  super.writeInternal(out);
  int count=data.size();
  out.writeInt(count);
  if (count > 0) {
    long now=Clock.currentTimeMillis();
    for (    Map.Entry<String,Map<Data,CacheRecord>> entry : data.entrySet()) {
      Map<Data,CacheRecord> cacheMap=entry.getValue();
      int subCount=cacheMap.size();
      out.writeInt(subCount);
      if (subCount > 0) {
        out.writeUTF(entry.getKey());
        for (        Map.Entry<Data,CacheRecord> e : cacheMap.entrySet()) {
          final Data key=e.getKey();
          final CacheRecord record=e.getValue();
          final long expirationTime=record.getExpirationTime();
          if (expirationTime > now) {
            key.writeData(out);
            out.writeObject(record);
          }
        }
        new Data().writeData(out);
      }
    }
  }
}
Program: 47869
Project: 47869
Buggy source:
AbstractCacheRecord(Data key,V value,long expirationTime){
  this.key=key;
  this.value=value;
  this.expirationTime=expirationTime;
}

Fixed version (ground truth):
public AbstractCacheRecord(){
}
Program: 47870
Project: 47870
Buggy source:
protected HttpResponse request(RequestType reqType,String context,int serverPort,CookieStore cookieStore) throws Exception {
  if (reqType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HttpClient client=HttpClientBuilder.create().disableRedirectHandling().setDefaultCookieStore(cookieStore).build();
  HttpUriRequest request=null;
switch (reqType) {
case GET_REQUEST:
    request=new HttpGet("String_Node_Str" + serverPort + "String_Node_Str"+ context);
  break;
case POST_REQUEST:
request=new HttpPost("String_Node_Str" + serverPort + "String_Node_Str"+ context);
break;
default :
throw new IllegalArgumentException(reqType + "String_Node_Str");
}
HttpResponse response=client.execute(request);
return response;
}

Fixed version (ground truth):
protected HttpResponse request(RequestType reqType,String context,int serverPort,CookieStore cookieStore) throws Exception {
  if (reqType == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  HttpClient client=HttpClientBuilder.create().disableRedirectHandling().setDefaultCookieStore(cookieStore).build();
  HttpUriRequest request;
switch (reqType) {
case GET_REQUEST:
    request=new HttpGet("String_Node_Str" + serverPort + "String_Node_Str"+ context);
  break;
case POST_REQUEST:
request=new HttpPost("String_Node_Str" + serverPort + "String_Node_Str"+ context);
break;
default :
throw new IllegalArgumentException(reqType + "String_Node_Str");
}
return client.execute(request);
}
Program: 47871
Project: 47871
Buggy source:
@Before public void setup() throws Exception {
  final URL root=new URL(TestServlet.class.getResource("String_Node_Str"),"String_Node_Str");
  final String baseDir=new File(root.getFile().replaceAll("String_Node_Str","String_Node_Str")).toString();
  final String sourceDir=baseDir + "String_Node_Str";
  hz=Hazelcast.newHazelcastInstance(new FileSystemXmlConfig(new File(sourceDir + "String_Node_Str","String_Node_Str")));
  serverPort1=availablePort();
  server1=getServletContainer(serverPort1,sourceDir,serverXml1);
  if (serverXml2 != null) {
    serverPort2=availablePort();
    server2=getServletContainer(serverPort2,sourceDir,serverXml2);
  }
}

Fixed version (ground truth):
@Before public void setup() throws Exception {
  ContainerContext cc=CONTAINER_CONTEXT_MAP.get(getClass());
  if (cc == null) {
    ensureInstanceIsUp();
    CONTAINER_CONTEXT_MAP.put(getClass(),new ContainerContext(this,serverXml1,serverXml2,serverPort1,serverPort2,server1,server2,hz));
  }
 else {
    cc.copyInto(this);
    ensureInstanceIsUp();
    cc.copyFrom(this);
  }
  IMap<String,Object> map=hz.getMap(DEFAULT_MAP_NAME);
  map.clear();
}
Program: 47872
Project: 47872
Buggy source:
public void buildTomcat(int port,String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
}

Fixed version (ground truth):
public void buildTomcat(String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
  running=true;
}
Program: 47873
Project: 47873
Buggy source:
@Override public void stop() throws LifecycleException {
  tomcat.stop();
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  tomcat.stop();
  tomcat.destroy();
  running=false;
}
Program: 47874
Project: 47874
Buggy source:
@Override public void restart() throws LifecycleException, InterruptedException {
  int port=tomcat.getConnector().getLocalPort();
  tomcat.stop();
  tomcat.destroy();
  Thread.sleep(5000);
  buildTomcat(port,sourceDir,serverXml);
  Thread.sleep(5000);
}

Fixed version (ground truth):
@Override public void restart() throws Exception {
  stop();
  Thread.sleep(5000);
  start();
}
Program: 47875
Project: 47875
Buggy source:
@Override public void start() throws Exception {
  tomcat.start();
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  buildTomcat(sourceDir,serverXml);
  running=true;
}
Program: 47876
Project: 47876
Buggy source:
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(port,sourceDir,serverXml);
}

Fixed version (ground truth):
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.port=port;
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(sourceDir,serverXml);
}
Program: 47877
Project: 47877
Buggy source:
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}

Fixed version (ground truth):
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}
Program: 47878
Project: 47878
Buggy source:
private void send(ItemEvent event){
  if (endpoint.live()) {
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}

Fixed version (ground truth):
private void send(ItemEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareItemEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}
Program: 47880
Project: 47880
Buggy source:
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
  if (endpoint.live()) {
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47881
Project: 47881
Buggy source:
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47882
Project: 47882
Buggy source:
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareEntryEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}
Program: 47883
Project: 47883
Buggy source:
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}
Program: 47884
Project: 47884
Buggy source:
private void send(ItemEvent event){
  if (endpoint.live()) {
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}

Fixed version (ground truth):
private void send(ItemEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareItemEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}
Program: 47885
Project: 47885
Buggy source:
@Override public void onMessage(Message message){
  if (!endpoint.live()) {
    return;
  }
  DataAwareMessage dataAwareMessage=(DataAwareMessage)message;
  Data messageData=dataAwareMessage.getMessageData();
  String publisherUuid=message.getPublishingMember().getUuid();
  PortableMessage portableMessage=new PortableMessage(messageData,message.getPublishTime(),publisherUuid);
  endpoint.sendEvent(portableMessage,callId);
}

Fixed version (ground truth):
@Override public void onMessage(Message message){
  if (!endpoint.live()) {
    return;
  }
  if (!(message instanceof DataAwareMessage)) {
    throw new IllegalArgumentException("String_Node_Str" + message.getClass().getSimpleName());
  }
  DataAwareMessage dataAwareMessage=(DataAwareMessage)message;
  Data messageData=dataAwareMessage.getMessageData();
  String publisherUuid=message.getPublishingMember().getUuid();
  PortableMessage portableMessage=new PortableMessage(messageData,message.getPublishTime(),publisherUuid);
  endpoint.sendEvent(portableMessage,callId);
}
Program: 47886
Project: 47886
Buggy source:
public void buildTomcat(int port,String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
  running=true;
}

Fixed version (ground truth):
public void buildTomcat(String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
  running=true;
}
Program: 47887
Project: 47887
Buggy source:
@Override public void stop() throws LifecycleException {
  tomcat.stop();
  running=false;
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  tomcat.stop();
  tomcat.destroy();
  running=false;
}
Program: 47888
Project: 47888
Buggy source:
@Override public void restart() throws LifecycleException, InterruptedException {
  int port=tomcat.getConnector().getLocalPort();
  tomcat.stop();
  running=false;
  tomcat.destroy();
  Thread.sleep(5000);
  buildTomcat(port,sourceDir,serverXml);
  Thread.sleep(5000);
  running=true;
}

Fixed version (ground truth):
@Override public void restart() throws Exception {
  stop();
  Thread.sleep(5000);
  start();
}
Program: 47889
Project: 47889
Buggy source:
@Override public void start() throws Exception {
  tomcat.start();
  running=true;
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  buildTomcat(sourceDir,serverXml);
  running=true;
}
Program: 47890
Project: 47890
Buggy source:
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(port,sourceDir,serverXml);
}

Fixed version (ground truth):
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.port=port;
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(sourceDir,serverXml);
}
Program: 47891
Project: 47891
Buggy source:
public void buildTomcat(int port,String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
  running=true;
}

Fixed version (ground truth):
public void buildTomcat(String sourceDir,String serverXml) throws LifecycleException {
  tomcat=new Tomcat();
  File baseDir=new File(System.getProperty("String_Node_Str"));
  tomcat.setPort(port);
  tomcat.setBaseDir(baseDir.getAbsolutePath());
  Context context=tomcat.addContext("String_Node_Str",sourceDir);
  context.getServletContext().setAttribute(Globals.ALT_DD_ATTR,sourceDir + "String_Node_Str" + serverXml);
  ContextConfig contextConfig=new ContextConfig();
  context.addLifecycleListener(contextConfig);
  context.setCookies(true);
  context.setBackgroundProcessorDelay(1);
  context.setReloadable(true);
  tomcat.getEngine().setJvmRoute("String_Node_Str" + port);
  tomcat.getEngine().setName("String_Node_Str" + port);
  tomcat.start();
  running=true;
}
Program: 47892
Project: 47892
Buggy source:
@Override public void stop() throws LifecycleException {
  tomcat.stop();
  running=false;
}

Fixed version (ground truth):
@Override public void stop() throws Exception {
  tomcat.stop();
  tomcat.destroy();
  running=false;
}
Program: 47893
Project: 47893
Buggy source:
@Override public void restart() throws LifecycleException, InterruptedException {
  int port=tomcat.getConnector().getLocalPort();
  tomcat.stop();
  running=false;
  tomcat.destroy();
  Thread.sleep(5000);
  buildTomcat(port,sourceDir,serverXml);
  Thread.sleep(5000);
  running=true;
}

Fixed version (ground truth):
@Override public void restart() throws Exception {
  stop();
  Thread.sleep(5000);
  start();
}
Program: 47894
Project: 47894
Buggy source:
@Override public void start() throws Exception {
  tomcat.start();
  running=true;
}

Fixed version (ground truth):
@Override public void start() throws Exception {
  buildTomcat(sourceDir,serverXml);
  running=true;
}
Program: 47895
Project: 47895
Buggy source:
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(port,sourceDir,serverXml);
}

Fixed version (ground truth):
public TomcatServer(int port,String sourceDir,String serverXml) throws Exception {
  this.port=port;
  this.serverXml=serverXml;
  this.sourceDir=sourceDir;
  buildTomcat(sourceDir,serverXml);
}
Program: 47896
Project: 47896
Buggy source:
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}

Fixed version (ground truth):
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}
Program: 47897
Project: 47897
Buggy source:
private void send(ItemEvent event){
  if (endpoint.live()) {
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}

Fixed version (ground truth):
private void send(ItemEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareItemEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}
Program: 47899
Project: 47899
Buggy source:
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
  if (endpoint.live()) {
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47900
Project: 47900
Buggy source:
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47901
Project: 47901
Buggy source:
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareEntryEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}
Program: 47902
Project: 47902
Buggy source:
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}
Program: 47903
Project: 47903
Buggy source:
private void send(ItemEvent event){
  if (endpoint.live()) {
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}

Fixed version (ground truth):
private void send(ItemEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareItemEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}
Program: 47904
Project: 47904
Buggy source:
@Override public void onMessage(Message message){
  if (!endpoint.live()) {
    return;
  }
  DataAwareMessage dataAwareMessage=(DataAwareMessage)message;
  Data messageData=dataAwareMessage.getMessageData();
  String publisherUuid=message.getPublishingMember().getUuid();
  PortableMessage portableMessage=new PortableMessage(messageData,message.getPublishTime(),publisherUuid);
  endpoint.sendEvent(portableMessage,callId);
}

Fixed version (ground truth):
@Override public void onMessage(Message message){
  if (!endpoint.live()) {
    return;
  }
  if (!(message instanceof DataAwareMessage)) {
    throw new IllegalArgumentException("String_Node_Str" + message.getClass().getSimpleName());
  }
  DataAwareMessage dataAwareMessage=(DataAwareMessage)message;
  Data messageData=dataAwareMessage.getMessageData();
  String publisherUuid=message.getPublishingMember().getUuid();
  PortableMessage portableMessage=new PortableMessage(messageData,message.getPublishTime(),publisherUuid);
  endpoint.sendEvent(portableMessage,callId);
}
Program: 47905
Project: 47905
Buggy source:
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}

Fixed version (ground truth):
private ItemListener createItemListener(final ClientEndpoint endpoint){
  return new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
}
Program: 47906
Project: 47906
Buggy source:
private void send(ItemEvent event){
  if (endpoint.live()) {
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}

Fixed version (ground truth):
private void send(ItemEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareItemEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
    Data item=dataAwareItemEvent.getItemData();
    PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableItemEvent,getCallId());
  }
}
Program: 47908
Project: 47908
Buggy source:
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
  if (endpoint.live()) {
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent<Object,Object> event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    Data oldValue=dataAwareEntryEvent.getOldValueData();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,oldValue,event.getEventType(),event.getMember().getUuid());
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47909
Project: 47909
Buggy source:
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}

Fixed version (ground truth):
@Override public void onEntryEvent(EntryEvent event){
  if (endpoint.live()) {
    if (!(event instanceof DataAwareEntryEvent)) {
      throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
    }
    DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
    Data key=dataAwareEntryEvent.getKeyData();
    Data value=dataAwareEntryEvent.getNewValueData();
    final EntryEventType type=event.getEventType();
    final String uuid=event.getMember().getUuid();
    PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
    endpoint.sendEvent(portableEntryEvent,getCallId());
  }
}
Program: 47910
Project: 47910
Buggy source:
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final MultiMapService service=getService();
  EntryListener listener=new EntryAdapter(){
    @Override public void onEntryEvent(    EntryEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareEntryEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareEntryEvent dataAwareEntryEvent=(DataAwareEntryEvent)event;
        Data key=dataAwareEntryEvent.getKeyData();
        Data value=dataAwareEntryEvent.getNewValueData();
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(key,value,null,type,uuid);
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
    @Override public void onMapEvent(    MapEvent event){
      if (endpoint.live()) {
        final EntryEventType type=event.getEventType();
        final String uuid=event.getMember().getUuid();
        PortableEntryEvent portableEntryEvent=new PortableEntryEvent(type,uuid,event.getNumberOfEntriesAffected());
        endpoint.sendEvent(portableEntryEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addListener(name,listener,key,includeValue,false);
  endpoint.setListenerRegistration(MultiMapService.SERVICE_NAME,name,registrationId);
  return registrationId;
}
Program: 47911
Project: 47911
Buggy source:
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}

Fixed version (ground truth):
@Override public Object call() throws Exception {
  final ClientEndpoint endpoint=getEndpoint();
  final QueueService service=getService();
  ItemListener listener=new ItemListener(){
    @Override public void itemAdded(    ItemEvent item){
      send(item);
    }
    @Override public void itemRemoved(    ItemEvent item){
      send(item);
    }
    private void send(    ItemEvent event){
      if (endpoint.live()) {
        if (!(event instanceof DataAwareItemEvent)) {
          throw new IllegalArgumentException("String_Node_Str" + event.getClass().getSimpleName());
        }
        DataAwareItemEvent dataAwareItemEvent=(DataAwareItemEvent)event;
        Data item=dataAwareItemEvent.getItemData();
        PortableItemEvent portableItemEvent=new PortableItemEvent(item,event.getEventType(),event.getMember().getUuid());
        endpoint.sendEvent(portableItemEvent,getCallId());
      }
    }
  }
;
  String registrationId=service.addItemListener(name,listener,includeValue);
  endpoint.setListenerRegistration(QueueService.SERVICE_NAME,name,registrationId);
  return registrationId;
}