nus-yam/ex-repair huggingface dataset:
Program: 50266
Project: 50266
Buggy source:
protected void customRun(){
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (oldConnection != null && restoredConnection(oldConnection,connection)) {
      redoUnfinishedCalls(oldConnection);
    }
    if (connection == null) {
      interruptWaitingCalls();
      Thread.sleep(50);
    }
 else {
      packet=reader.readPacket(connection);
      logger.log(Level.FINEST,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str" + e.toString());
    client.connectionManager.destroyConnection(connection);
  }
}

Fixed version (ground truth):
protected void customRun(){
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (oldConnection != null && restoredConnection(oldConnection,connection)) {
      redoUnfinishedCalls(oldConnection);
    }
    if (connection == null) {
      outRunnable.clusterIsDown();
      Thread.sleep(50);
    }
 else {
      packet=reader.readPacket(connection);
      logger.log(Level.FINEST,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str" + e.toString());
    client.connectionManager.destroyConnection(connection);
  }
}
Program: 50267
Project: 50267
Buggy source:
private void clusterIsDown(){
  interruptWaitingCalls();
  if (!reconnection) {
    reconnection=true;
    final Thread thread=new Thread(new Runnable(){
      public void run(){
        try {
          final Connection c=client.getConnectionManager().lookForAliveConnection();
          final Connection oldConnection=connection;
          connection=c;
          if (connection == null) {
            if (reconnection) {
              reconnection=false;
              interruptWaitingCallsAndShutdown();
            }
          }
 else           if (restoredConnection(oldConnection,connection)) {
            resubscribe(oldConnection);
          }
        }
  finally {
          reconnection=false;
        }
      }
    }
);
    thread.setName("String_Node_Str");
    thread.setDaemon(true);
    thread.start();
  }
}

Fixed version (ground truth):
void clusterIsDown(){
  interruptWaitingCalls();
  if (!reconnection) {
    reconnection=true;
    final Thread thread=new Thread(new Runnable(){
      public void run(){
        try {
          if (client.getConnectionManager().lookForAliveConnection() == null) {
            if (reconnection) {
              interruptWaitingCallsAndShutdown();
            }
          }
 else {
            try {
              queue.put(RECONNECT_CALL);
            }
 catch (            InterruptedException e) {
            }
          }
        }
  finally {
          reconnection=false;
        }
      }
    }
);
    thread.setName("String_Node_Str");
    thread.setDaemon(true);
    thread.start();
  }
}
Program: 50268
Project: 50268
Buggy source:
protected void customRun() throws InterruptedException {
  Call call=queue.poll(100,TimeUnit.MILLISECONDS);
  try {
    if (call == null)     return;
    int count=0;
    while (call != null) {
      callMap.put(call.getId(),call);
      Connection oldConnection=connection;
      connection=client.getConnectionManager().getConnection();
      if (restoredConnection(oldConnection,connection)) {
        resubscribe(call,oldConnection);
      }
 else       if (connection != null) {
        logger.log(Level.FINEST,"String_Node_Str" + call);
        writer.write(connection,call.getRequest());
      }
 else {
        clusterIsDown();
      }
      call=null;
      if (count++ < 24) {
        call=queue.poll();
      }
    }
    if (connection != null) {
      writer.flush(connection);
    }
  }
 catch (  Throwable io) {
    logger.log(Level.FINE,"String_Node_Str" + io.getMessage());
    io.printStackTrace();
    enQueue(call);
    client.getConnectionManager().destroyConnection(connection);
  }
}

Fixed version (ground truth):
protected void customRun() throws InterruptedException {
  Call call=queue.poll(100,TimeUnit.MILLISECONDS);
  try {
    if (call == null)     return;
    int count=0;
    while (call != null) {
      if (call != RECONNECT_CALL) {
        callMap.put(call.getId(),call);
      }
      Connection oldConnection=connection;
      connection=client.getConnectionManager().getConnection();
      if (restoredConnection(oldConnection,connection)) {
        resubscribe(call,oldConnection);
      }
 else       if (connection != null) {
        if (call != RECONNECT_CALL) {
          logger.log(Level.FINEST,"String_Node_Str" + call);
          writer.write(connection,call.getRequest());
        }
      }
 else {
        clusterIsDown();
      }
      call=null;
      if (count++ < 24) {
        call=queue.poll();
      }
    }
    if (connection != null) {
      writer.flush(connection);
    }
  }
 catch (  Throwable io) {
    logger.log(Level.FINE,"String_Node_Str" + io.getMessage());
    io.printStackTrace();
    enQueue(call);
    client.getConnectionManager().destroyConnection(connection);
  }
}
Program: 50269
Project: 50269
Buggy source:
private void resubscribe(Connection oldConnection){
  queue.addAll(client.getListenerManager().getListenerCalls());
  if (oldConnection != null) {
    onDisconnect(oldConnection);
  }
}

Fixed version (ground truth):
private void resubscribe(Call call,Connection oldConnection){
  final BlockingQueue<Call> temp=new LinkedBlockingQueue<Call>();
  temp.add(call);
  queue.drainTo(temp);
  queue.addAll(client.getListenerManager().getListenerCalls());
  temp.drainTo(queue);
  onDisconnect(oldConnection);
}
Program: 50270
Project: 50270
Buggy source:
public void run(){
  try {
    final Connection c=client.getConnectionManager().lookForAliveConnection();
    final Connection oldConnection=connection;
    connection=c;
    if (connection == null) {
      if (reconnection) {
        reconnection=false;
        interruptWaitingCallsAndShutdown();
      }
    }
 else     if (restoredConnection(oldConnection,connection)) {
      resubscribe(oldConnection);
    }
  }
  finally {
    reconnection=false;
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (client.getConnectionManager().lookForAliveConnection() == null) {
      if (reconnection) {
        interruptWaitingCallsAndShutdown();
      }
    }
 else {
      try {
        queue.put(RECONNECT_CALL);
      }
 catch (      InterruptedException e) {
      }
    }
  }
  finally {
    reconnection=false;
  }
}
Program: 50272
Project: 50272
Buggy source:
public void addInstanceListener(InstanceListener listener){
  check(listener);
  if (client.getListenerManager().getInstanceListenerManager().noInstanceListenerRegistered()) {
    Packet request=proxyHelper.createRequestPacket(ClusterOperation.CLIENT_ADD_INSTANCE_LISTENER,null,null);
    Call c=proxyHelper.createCall(request);
    client.getListenerManager().addListenerCall(c);
    proxyHelper.doCall(c);
  }
  client.getListenerManager().getInstanceListenerManager().registerInstanceListener(listener);
}

Fixed version (ground truth):
public void addInstanceListener(InstanceListener listener){
  check(listener);
  if (instanceListenerManager().noInstanceListenerRegistered()) {
    Call c=instanceListenerManager().createNewAddListenerCall(proxyHelper);
    proxyHelper.doCall(c);
  }
  instanceListenerManager().registerInstanceListener(listener);
}
Program: 50273
Project: 50273
Buggy source:
public void removeInstanceListener(InstanceListener instanceListener){
  check(instanceListener);
  client.getListenerManager().getInstanceListenerManager().removeInstanceListener(instanceListener);
}

Fixed version (ground truth):
public void removeInstanceListener(InstanceListener instanceListener){
  check(instanceListener);
  instanceListenerManager().removeInstanceListener(instanceListener);
}
Program: 50274
Project: 50274
Buggy source:
public synchronized void removeItemListener(ItemListener<E> listener){
  check(listener);
  proxyHelper.getHazelcastClient().getListenerManager().getItemListenerManager().removeItemListener(name,listener);
  Packet request=proxyHelper.createRequestPacket(ClusterOperation.REMOVE_LISTENER,null,null);
  Call c=proxyHelper.createCall(request);
  proxyHelper.doCall(c);
}

Fixed version (ground truth):
public synchronized void removeItemListener(ItemListener<E> listener){
  check(listener);
  itemListenerManager().removeItemListener(name,listener);
  Packet request=proxyHelper.createRequestPacket(ClusterOperation.REMOVE_LISTENER,null,null);
  Call c=proxyHelper.createCall(request);
  proxyHelper.doCall(c);
}
Program: 50275
Project: 50275
Buggy source:
public synchronized void addItemListener(ItemListener<E> listener,boolean includeValue){
  check(listener);
  Packet request=proxyHelper.createRequestPacket(ClusterOperation.ADD_LISTENER,null,null);
  request.setLongValue(includeValue ? 1 : 0);
  Call c=proxyHelper.createCall(request);
  proxyHelper.getHazelcastClient().getListenerManager().addListenerCall(c);
  proxyHelper.getHazelcastClient().getListenerManager().getItemListenerManager().registerItemListener(name,listener);
  proxyHelper.doCall(c);
}

Fixed version (ground truth):
public synchronized void addItemListener(ItemListener<E> listener,boolean includeValue){
  check(listener);
  Call c=itemListenerManager().createNewAddListenerCall(proxyHelper,includeValue);
  itemListenerManager().registerItemListener(name,listener);
  proxyHelper.doCall(c);
}
Program: 50276
Project: 50276
Buggy source:
protected boolean restoredConnection(Connection oldConnection,Connection newConnection){
  long oldConnectionId=-1;
  boolean isOldConnectionNull=(oldConnection == null);
  if (!isOldConnectionNull) {
    oldConnectionId=oldConnection.getVersion();
  }
  return restoredConnection(newConnection,isOldConnectionNull,oldConnectionId);
}

Fixed version (ground truth):
protected boolean restoredConnection(Connection oldConnection,Connection newConnection){
  final boolean isOldConnectionNull=oldConnection == null;
  final long oldConnectionId=oldConnection == null ? -1 : oldConnection.getVersion();
  return restoredConnection(newConnection,isOldConnectionNull,oldConnectionId);
}
Program: 50277
Project: 50277
Buggy source:
protected void customRun(){
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (restoredConnection(oldConnection,connection)) {
      onDisconnect(oldConnection);
    }
    if (connection == null) {
      interruptWaitingCalls();
      Thread.sleep(50);
    }
 else {
      packet=reader.readPacket(connection);
      logger.log(Level.FINEST,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str" + e.toString());
    client.connectionManager.destroyConnection(connection);
  }
}

Fixed version (ground truth):
protected void customRun(){
  Packet packet;
  try {
    Connection oldConnection=connection;
    connection=client.connectionManager.getConnection();
    if (restoredConnection(oldConnection,connection)) {
      redoUnfinishedCalls(oldConnection);
    }
    if (connection == null) {
      interruptWaitingCalls();
      Thread.sleep(50);
    }
 else {
      packet=reader.readPacket(connection);
      logger.log(Level.FINEST,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
      Call call=callMap.remove(packet.getCallId());
      if (call != null) {
        call.setResponse(packet);
      }
 else {
        if (packet.getOperation().equals(ClusterOperation.EVENT)) {
          client.getListenerManager().enqueue(packet);
        }
        if (packet.getCallId() != -1) {
          logger.log(Level.SEVERE,"String_Node_Str" + packet.getOperation() + "String_Node_Str"+ packet.getCallId());
        }
      }
    }
  }
 catch (  RuntimeException re) {
    throw re;
  }
catch (  Exception e) {
    logger.log(Level.FINE,"String_Node_Str" + e.toString());
    client.connectionManager.destroyConnection(connection);
  }
}
Program: 50278
Project: 50278
Buggy source:
public String getName(){
  return name.substring(2);
}

Fixed version (ground truth):
public String getName(){
  return name.substring(Prefix.MAP.length());
}
Program: 50279
Project: 50279
Buggy source:
public void removeEntryListener(EntryListener<K,V> listener,K key){
  check(listener);
  check(key);
  proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
  proxyHelper.getHazelcastClient().getListenerManager().getEntryListenerManager().removeEntryListener(name,key,listener);
}

Fixed version (ground truth):
public void removeEntryListener(EntryListener<K,V> listener,K key){
  check(listener);
  check(key);
  proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
  listenerManager().removeEntryListener(name,key,listener);
}
Program: 50280
Project: 50280
Buggy source:
public void addEntryListener(EntryListener<K,V> listener,K key,boolean includeValue){
  check(listener);
  Boolean noEntryListenerRegistered=proxyHelper.getHazelcastClient().getListenerManager().getEntryListenerManager().noEntryListenerRegistered(key,name,includeValue);
  if (noEntryListenerRegistered == null) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
    noEntryListenerRegistered=Boolean.TRUE;
  }
  if (noEntryListenerRegistered) {
    Packet request=proxyHelper.createRequestPacket(ClusterOperation.ADD_LISTENER,toByte(key),null);
    request.setLongValue(includeValue ? 1 : 0);
    Call c=proxyHelper.createCall(request);
    proxyHelper.getHazelcastClient().getListenerManager().addListenerCall(c);
    proxyHelper.doCall(c);
  }
  proxyHelper.getHazelcastClient().getListenerManager().getEntryListenerManager().registerEntryListener(name,key,includeValue,listener);
}

Fixed version (ground truth):
public void addEntryListener(EntryListener<K,V> listener,K key,boolean includeValue){
  check(listener);
  Boolean noEntryListenerRegistered=listenerManager().noEntryListenerRegistered(key,name,includeValue);
  if (noEntryListenerRegistered == null) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
    noEntryListenerRegistered=Boolean.TRUE;
  }
  if (noEntryListenerRegistered) {
    Call c=listenerManager().createNewAddListenerCall(proxyHelper,key,includeValue);
    proxyHelper.doCall(c);
  }
  listenerManager().registerEntryListener(name,key,includeValue,listener);
}
Program: 50281
Project: 50281
Buggy source:
@Override public boolean equals(Object o){
  if (o instanceof IMap && o != null) {
    return getName().equals(((IMap)o).getName());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o instanceof IMap) {
    return getName().equals(((IMap)o).getName());
  }
  return false;
}
Program: 50282
Project: 50282
Buggy source:
public String getName(){
  return name.substring(4);
}

Fixed version (ground truth):
public String getName(){
  return name.substring(Prefix.MULTIMAP.length());
}
Program: 50283
Project: 50283
Buggy source:
public void removeEntryListener(EntryListener<K,V> listener,K key){
  check(listener);
  check(key);
  proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
  client.getListenerManager().getEntryListenerManager().removeEntryListener(name,key,listener);
}

Fixed version (ground truth):
public void removeEntryListener(EntryListener<K,V> listener,K key){
  check(listener);
  check(key);
  proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
  entryListenerManager().removeEntryListener(name,key,listener);
}
Program: 50284
Project: 50284
Buggy source:
public void addEntryListener(EntryListener<K,V> listener,K key,boolean includeValue){
  check(listener);
  Boolean noEntryListenerRegistered=client.getListenerManager().getEntryListenerManager().noEntryListenerRegistered(key,name,includeValue);
  if (noEntryListenerRegistered == null) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
    noEntryListenerRegistered=Boolean.TRUE;
  }
  if (noEntryListenerRegistered.booleanValue()) {
    Packet request=proxyHelper.createRequestPacket(ClusterOperation.ADD_LISTENER,toByte(key),null);
    request.setLongValue(includeValue ? 1 : 0);
    Call c=proxyHelper.createCall(request);
    client.getListenerManager().addListenerCall(c);
    proxyHelper.doCall(c);
  }
  client.getListenerManager().getEntryListenerManager().registerEntryListener(name,key,includeValue,listener);
}

Fixed version (ground truth):
public void addEntryListener(EntryListener<K,V> listener,K key,boolean includeValue){
  check(listener);
  Boolean noEntryListenerRegistered=entryListenerManager().noEntryListenerRegistered(key,name,includeValue);
  if (noEntryListenerRegistered == null) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,key,null);
    noEntryListenerRegistered=Boolean.TRUE;
  }
  if (noEntryListenerRegistered.booleanValue()) {
    Call c=entryListenerManager().createNewAddListenerCall(proxyHelper,key,includeValue);
    proxyHelper.doCall(c);
  }
  entryListenerManager().registerEntryListener(name,key,includeValue,listener);
}
Program: 50285
Project: 50285
Buggy source:
@Override public boolean equals(Object o){
  if (o instanceof MultiMap && o != null) {
    return getName().equals(((MultiMap)o).getName());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o instanceof MultiMap) {
    return getName().equals(((MultiMap)o).getName());
  }
  return false;
}
Program: 50286
Project: 50286
Buggy source:
protected void customRun() throws InterruptedException {
  Call call=queue.poll(100,TimeUnit.MILLISECONDS);
  try {
    if (call == null)     return;
    int count=0;
    while (call != null) {
      callMap.put(call.getId(),call);
      Connection oldConnection=connection;
      connection=client.getConnectionManager().getConnection();
      if (restoredConnection(oldConnection,connection)) {
        redoUnfinishedCalls(call,oldConnection);
      }
 else       if (connection != null) {
        logger.log(Level.FINEST,"String_Node_Str" + call);
        writer.write(connection,call.getRequest());
      }
 else {
        interruptWaitingCalls();
      }
      call=null;
      if (count++ < 24) {
        call=queue.poll();
      }
    }
    if (connection != null) {
      writer.flush(connection);
    }
  }
 catch (  Throwable io) {
    logger.log(Level.FINE,"String_Node_Str" + io.getMessage());
    io.printStackTrace();
    enQueue(call);
    client.getConnectionManager().destroyConnection(connection);
  }
}

Fixed version (ground truth):
protected void customRun() throws InterruptedException {
  Call call=queue.poll(100,TimeUnit.MILLISECONDS);
  try {
    if (call == null)     return;
    int count=0;
    while (call != null) {
      callMap.put(call.getId(),call);
      Connection oldConnection=connection;
      connection=client.getConnectionManager().getConnection();
      if (restoredConnection(oldConnection,connection)) {
        resubscribe(call,oldConnection);
      }
 else       if (connection != null) {
        logger.log(Level.FINEST,"String_Node_Str" + call);
        writer.write(connection,call.getRequest());
      }
 else {
        interruptWaitingCalls();
      }
      call=null;
      if (count++ < 24) {
        call=queue.poll();
      }
    }
    if (connection != null) {
      writer.flush(connection);
    }
  }
 catch (  Throwable io) {
    logger.log(Level.FINE,"String_Node_Str" + io.getMessage());
    io.printStackTrace();
    enQueue(call);
    client.getConnectionManager().destroyConnection(connection);
  }
}
Program: 50287
Project: 50287
Buggy source:
public String getName(){
  return name.substring(2);
}

Fixed version (ground truth):
public String getName(){
  return name.substring(Prefix.TOPIC.length());
}
Program: 50288
Project: 50288
Buggy source:
public synchronized void addMessageListener(MessageListener messageListener){
  check(messageListener);
  boolean shouldCall=proxyHelper.getHazelcastClient().getListenerManager().getMessageListenerManager().noMessageListenerRegistered(name);
  proxyHelper.getHazelcastClient().getListenerManager().getMessageListenerManager().registerMessageListener(name,messageListener);
  if (shouldCall) {
    doAddListenerCall(messageListener);
  }
}

Fixed version (ground truth):
public synchronized void addMessageListener(MessageListener messageListener){
  check(messageListener);
  boolean shouldCall=messageListenerManager().noMessageListenerRegistered(name);
  messageListenerManager().registerMessageListener(name,messageListener);
  if (shouldCall) {
    doAddListenerCall(messageListener);
  }
}
Program: 50289
Project: 50289
Buggy source:
private void doAddListenerCall(MessageListener messageListener){
  Packet request=proxyHelper.prepareRequest(ClusterOperation.ADD_LISTENER,null,null);
  Call c=proxyHelper.createCall(request);
  proxyHelper.getHazelcastClient().getListenerManager().addListenerCall(c);
  proxyHelper.doCall(c);
}

Fixed version (ground truth):
private void doAddListenerCall(MessageListener messageListener){
  Call c=messageListenerManager().createNewAddListenerCall(proxyHelper);
  proxyHelper.doCall(c);
}
Program: 50290
Project: 50290
Buggy source:
public synchronized void removeMessageListener(MessageListener messageListener){
  check(messageListener);
  proxyHelper.getHazelcastClient().getListenerManager().getMessageListenerManager().removeMessageListener(name,messageListener);
  if (proxyHelper.getHazelcastClient().getListenerManager().getMessageListenerManager().noMessageListenerRegistered(name)) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,null,null);
  }
}

Fixed version (ground truth):
public synchronized void removeMessageListener(MessageListener messageListener){
  check(messageListener);
  messageListenerManager().removeMessageListener(name,messageListener);
  if (messageListenerManager().noMessageListenerRegistered(name)) {
    proxyHelper.doOp(ClusterOperation.REMOVE_LISTENER,null,null);
  }
}
Program: 50291
Project: 50291
Buggy source:
@Override public boolean equals(Object o){
  if (o instanceof ITopic && o != null) {
    return getName().equals(((ITopic)o).getName());
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (o instanceof ITopic) {
    return getName().equals(((ITopic)o).getName());
  }
  return false;
}
Program: 50292
Project: 50292
Buggy source:
public void readData(DataInput in) throws IOException {
  int size=in.readInt();
  keys=new ArrayList<K>();
  for (int i=0; i < size; i++) {
    int length=in.readInt();
    byte[] data=new byte[length];
    in.readFully(data);
    K obj=(K)toObject(data);
    keys.add(obj);
  }
}

Fixed version (ground truth):
public void readData(DataInput in) throws IOException {
  int size=in.readInt();
  keys=new ArrayList<K>(size);
  for (int i=0; i < size; i++) {
    int length=in.readInt();
    byte[] data=new byte[length];
    in.readFully(data);
    K obj=(K)toObject(data);
    keys.add(obj);
  }
}
Program: 50293
Project: 50293
Buggy source:
@Test public void testRun() throws Exception {
  final AtomicInteger counter=new AtomicInteger(0);
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
      counter.incrementAndGet();
    }
  }
;
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(10);
        clientRunnable.running=false;
synchronized (clientRunnable.monitor) {
          clientRunnable.monitor.wait();
        }
        latch.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  clientRunnable.run();
  assertTrue(counter.get() > 1);
  assertTrue("String_Node_Str",latch.await(5,TimeUnit.SECONDS));
}

Fixed version (ground truth):
@Test public void testRun() throws Exception {
  final AtomicInteger counter=new AtomicInteger(0);
  final ClientRunnable clientRunnable=new ClientRunnable(){
    @Override protected void customRun() throws InterruptedException {
      counter.incrementAndGet();
    }
  }
;
  final CountDownLatch latch=new CountDownLatch(1);
  new Thread(new Runnable(){
    public void run(){
      try {
        Thread.sleep(50);
        clientRunnable.running=false;
synchronized (clientRunnable.monitor) {
          clientRunnable.monitor.wait();
        }
        latch.countDown();
      }
 catch (      InterruptedException e) {
      }
    }
  }
).start();
  clientRunnable.run();
  assertTrue(counter.get() > 1);
  assertTrue("String_Node_Str",latch.await(25,TimeUnit.SECONDS));
}
Program: 50294
Project: 50294
Buggy source:
@Test(expected=UnsupportedOperationException.class) public void testToArrayWithArgument() throws Exception {
  EntryHolder entryHolder=mock(EntryHolder.class);
  Set set=new HashSet();
  ValueCollection valueCollection=new ValueCollection(entryHolder,set);
  valueCollection.toArray(null);
}

Fixed version (ground truth):
@Test(expected=NullPointerException.class) public void testToArrayWithArgument() throws Exception {
  EntryHolder entryHolder=mock(EntryHolder.class);
  Set set=new HashSet();
  ValueCollection valueCollection=new ValueCollection(entryHolder,set);
  valueCollection.toArray(null);
}
Program: 50296
Project: 50296
Buggy source:
public CMap getOrCreateMap(String name){
  checkServiceThread();
  CMap map=maps.get(name);
  if (map == null) {
    map=new CMap(this,name);
    maps.put(name,map);
  }
  return map;
}

Fixed version (ground truth):
public CMap getOrCreateMap(String name){
  checkServiceThread();
  CMap map=maps.get(name);
  if (map == null) {
    map=new CMap(this,name);
    CMap anotherMap=maps.putIfAbsent(name,map);
    if (anotherMap != null) {
      map=anotherMap;
    }
  }
  return map;
}
Program: 50297
Project: 50297
Buggy source:
@Test public void testIssue290() throws Exception {
  String mapName="String_Node_Str";
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=new MapConfig();
  mapConfig.setName(mapName);
  mapConfig.setTimeToLiveSeconds(1);
  config.getMapConfigs().put(mapName,mapConfig);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  try {
    IMap<Object,Object> m1=h1.getMap(mapName);
    m1.put(1,1);
    assertEquals(1,m1.get(1));
    assertEquals(1,m1.get(1));
    Thread.sleep(2500);
    assertEquals(null,m1.get(1));
    m1.put(1,1);
    assertEquals(1,m1.get(1));
  }
  finally {
    h1.getLifecycleService().shutdown();
  }
}

Fixed version (ground truth):
@Test public void testIssue290() throws Exception {
  String mapName="String_Node_Str";
  Config config=new XmlConfigBuilder().build();
  MapConfig mapConfig=new MapConfig();
  mapConfig.setName(mapName);
  mapConfig.setTimeToLiveSeconds(1);
  config.getMapConfigs().put(mapName,mapConfig);
  config.setGroupConfig(new GroupConfig("String_Node_Str","String_Node_Str"));
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  assertEquals(1,h1.getCluster().getMembers().size());
  try {
    IMap<Object,Object> m1=h1.getMap(mapName);
    m1.put(1,1);
    assertEquals(1,m1.get(1));
    assertEquals(1,m1.get(1));
    Thread.sleep(1050);
    assertEquals(null,m1.get(1));
    m1.put(1,1);
    assertEquals(1,m1.get(1));
  }
  finally {
    h1.getLifecycleService().shutdown();
  }
}
Program: 50298
Project: 50298
Buggy source:
@Test(expected=NullPointerException.class) public void testToArrayWithArgument() throws Exception {
  EntryHolder entryHolder=mock(EntryHolder.class);
  Set set=new HashSet();
  ValueCollection valueCollection=new ValueCollection(entryHolder,set);
  valueCollection.toArray(null);
}

Fixed version (ground truth):
@Test public void testToArrayWithArgument(){
  EntryHolder entryHolder=mock(EntryHolder.class);
  Set set=new HashSet();
  set.add(new MapEntry("String_Node_Str","String_Node_Str"));
  set.add(new MapEntry("String_Node_Str","String_Node_Str"));
  set.add(new MapEntry("String_Node_Str","String_Node_Str"));
  ValueCollection valueCollection=new ValueCollection(entryHolder,set);
{
    final Object[] values=valueCollection.toArray();
    Arrays.sort(values);
    assertArrayEquals(new Object[]{"String_Node_Str","String_Node_Str","String_Node_Str"},values);
  }
{
    final String[] values=(String[])valueCollection.toArray(new String[3]);
    Arrays.sort(values);
    assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},values);
  }
{
    final String[] values=(String[])valueCollection.toArray(new String[2]);
    Arrays.sort(values);
    assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},values);
  }
{
    final String[] values=(String[])valueCollection.toArray(new String[5]);
    Arrays.sort(values,0,3);
    assertArrayEquals(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str",null,null},values);
  }
}
Program: 50299
Project: 50299
Buggy source:
public void sendJoinRequest(Address toAddress){
  if (toAddress == null) {
    toAddress=node.getMasterAddress();
  }
  sendProcessableTo(new JoinRequest(thisAddress,node.getConfig().getGroupConfig().getName(),node.getConfig().getGroupConfig().getPassword(),node.getLocalNodeType(),Packet.PACKET_VERSION,node.getBuildNumber()),toAddress);
}

Fixed version (ground truth):
public void sendJoinRequest(Address toAddress){
  if (toAddress == null) {
    toAddress=node.getMasterAddress();
  }
  sendProcessableTo(node.createJoinInfo(),toAddress);
}
Program: 50300
Project: 50300
Buggy source:
void handleJoinRequest(JoinRequest joinRequest){
  logger.log(Level.FINEST,joinInProgress + "String_Node_Str" + joinRequest);
  if (getMember(joinRequest.address) != null)   return;
  Connection conn=joinRequest.getConnection();
  if (node.validateJoinRequest(joinRequest)) {
    if (!node.getConfig().getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
      if (node.isActive() && node.joined() && node.getMasterAddress() != null && !isMaster()) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
      }
    }
    if (isMaster() && node.joined() && node.isActive()) {
      if (joinRequest.to != null && !joinRequest.to.equals(thisAddress)) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
        return;
      }
      if (!joinInProgress) {
        MemberInfo newMemberInfo=new MemberInfo(joinRequest.address,joinRequest.nodeType);
        if (setJoins.add(newMemberInfo)) {
          sendProcessableTo(new Master(node.getMasterAddress()),conn);
          timeToStartJoin=System.currentTimeMillis() + WAIT_MILLIS_BEFORE_JOIN;
        }
 else {
          if (System.currentTimeMillis() > timeToStartJoin) {
            startJoin();
          }
        }
      }
    }
  }
 else {
    conn.close();
  }
}

Fixed version (ground truth):
void handleJoinRequest(JoinRequest joinRequest){
  logger.log(Level.FINEST,joinInProgress + "String_Node_Str" + joinRequest);
  if (getMember(joinRequest.address) != null) {
    return;
  }
  Connection conn=joinRequest.getConnection();
  if (node.validateJoinRequest(joinRequest)) {
    if (!node.getConfig().getNetworkConfig().getJoin().getMulticastConfig().isEnabled()) {
      if (node.isActive() && node.joined() && node.getMasterAddress() != null && !isMaster()) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
      }
    }
    if (isMaster() && node.joined() && node.isActive()) {
      if (joinRequest.to != null && !joinRequest.to.equals(thisAddress)) {
        sendProcessableTo(new Master(node.getMasterAddress()),conn);
        return;
      }
      if (!joinInProgress) {
        MemberInfo newMemberInfo=new MemberInfo(joinRequest.address,joinRequest.nodeType);
        if (setJoins.add(newMemberInfo)) {
          sendProcessableTo(new Master(node.getMasterAddress()),conn);
          timeToStartJoin=System.currentTimeMillis() + WAIT_MILLIS_BEFORE_JOIN;
        }
 else {
          if (System.currentTimeMillis() > timeToStartJoin) {
            startJoin();
          }
        }
      }
    }
  }
 else {
    conn.close();
  }
}
Program: 50301
Project: 50301
Buggy source:
@Override public void readData(DataInput dis) throws IOException {
  setRequest(dis.readBoolean());
  address=new Address();
  address.readData(dis);
  groupName=dis.readUTF();
  groupPassword=dis.readUTF();
  packetVersion=dis.readByte();
  buildNumber=dis.readInt();
  memberCount=dis.readInt();
}

Fixed version (ground truth):
@Override public void readData(DataInput dis) throws IOException {
  super.readData(dis);
  setRequest(dis.readBoolean());
  memberCount=dis.readInt();
}
Program: 50302
Project: 50302
Buggy source:
@Override public void writeData(DataOutput out) throws IOException {
  try {
    out.writeBoolean(isRequest());
    address.writeData(out);
    out.writeUTF(groupName);
    out.writeUTF(groupPassword);
    out.writeByte(Packet.PACKET_VERSION);
    out.writeInt(buildNumber);
    out.writeInt(memberCount);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void writeData(DataOutput out) throws IOException {
  try {
    super.writeData(out);
    out.writeBoolean(isRequest());
    out.writeInt(memberCount);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 50304
Project: 50304
Buggy source:
void setAsMaster(){
  logger.log(Level.FINE,"String_Node_Str");
  masterAddress=address;
  logger.log(Level.FINEST,"String_Node_Str");
  clusterManager.addMember(address,getLocalNodeType());
  clusterImpl.setMembers(baseVariables.lsMembers);
  unlock();
}

Fixed version (ground truth):
void setAsMaster(){
  logger.log(Level.FINEST,"String_Node_Str");
  masterAddress=address;
  logger.log(Level.FINEST,"String_Node_Str");
  clusterManager.addMember(address,getLocalNodeType());
  clusterImpl.setMembers(baseVariables.lsMembers);
  unlock();
}
Program: 50305
Project: 50305
Buggy source:
private void connectAndSendJoinRequest(Address masterAddress) throws Exception {
  if (masterAddress == null || masterAddress.equals(address)) {
    throw new IllegalArgumentException();
  }
  Connection conn=connectionManager.getOrConnect(masterAddress);
  logger.log(Level.FINEST,"String_Node_Str" + conn);
  if (conn != null) {
    clusterManager.sendJoinRequest(masterAddress);
  }
}

Fixed version (ground truth):
private void connectAndSendJoinRequest(Collection<Address> colPossibleAddresses){
  int numberOfJoinReq=0;
  colPossibleAddresses.removeAll(failedConnections);
  for (  Address possibleAddress : colPossibleAddresses) {
    final Connection conn=connectionManager.getOrConnect(possibleAddress);
    if (conn != null && numberOfJoinReq < 5) {
      logger.log(Level.FINEST,"String_Node_Str" + possibleAddress);
      clusterManager.sendJoinRequest(possibleAddress);
      numberOfJoinReq++;
    }
 else {
      logger.log(Level.FINEST,"String_Node_Str" + possibleAddress + "String_Node_Str");
    }
  }
}
Program: 50306
Project: 50306
Buggy source:
/** 
 * Adds an index to this map based on the provided expression.
 * @param expression The expression for the index.
 * @param ordered   <tt>true</tt> if index should be ordered,<tt>false</tt> otherwise.
 */
void addIndex(Expression<?> expression,boolean ordered);

Fixed version (ground truth):
/** 
 * Adds an index to this map based on the provided expression.
 * @param expression The expression for the index.
 * @param ordered    <tt>true</tt> if index should be ordered,<tt>false</tt> otherwise.
 */
void addIndex(Expression<?> expression,boolean ordered);
Program: 50307
Project: 50307
Buggy source:
public Object waitAndGetResult(){
  while (true) {
    try {
      Object obj=responses.poll(5,TimeUnit.SECONDS);
      if (obj != null) {
        return obj;
      }
      node.checkNodeState();
    }
 catch (    InterruptedException e) {
      if (node.factory.restarted) {
        throw new RuntimeException();
      }
 else {
        throw new RuntimeInterruptedException();
      }
    }
  }
}

Fixed version (ground truth):
public Object waitAndGetResult(){
  while (true) {
    try {
      Object obj=responses.poll(5,TimeUnit.SECONDS);
      if (obj != null) {
        return obj;
      }
      node.checkNodeState();
    }
 catch (    InterruptedException e) {
      handleInterruptedException();
    }
  }
}
Program: 50309
Project: 50309
Buggy source:
public void readData(DataInput in) throws IOException {
  address=new Address();
  address.readData(in);
  nodeType=NodeType.create(in.readInt());
}

Fixed version (ground truth):
public void readData(DataInput in) throws IOException {
  address=new Address();
  address.readData(in);
  nodeType=NodeType.create(in.readInt());
  this.lastRead=System.currentTimeMillis();
}
Program: 50310
Project: 50310
Buggy source:
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(address.getHost());
  sb.append("String_Node_Str");
  sb.append(address.getPort());
  sb.append("String_Node_Str");
  if (localMember) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder sb=new StringBuilder("String_Node_Str");
  sb.append(address.getHost());
  sb.append("String_Node_Str");
  sb.append(address.getPort());
  sb.append("String_Node_Str");
  if (localMember) {
    sb.append("String_Node_Str");
  }
  if (nodeType == NodeType.SUPER_CLIENT) {
    sb.append("String_Node_Str");
  }
  return sb.toString();
}
Program: 50312
Project: 50312
Buggy source:
public void process(){
  clusterManager.addMember(getThisAddress(),NodeType.MEMBER);
}

Fixed version (ground truth):
public void process(){
  clusterManager.addMember(getThisAddress(),localNodeType);
}
Program: 50314
Project: 50314
Buggy source:
@Override public void init(HazelcastInstance hazelcastInstance,Properties properties,String mapName){
  this.hazelcastInstance=hazelcastInstance;
  this.properties=properties;
  this.mapName=mapName;
  initCount.incrementAndGet();
}

Fixed version (ground truth):
public void init(HazelcastInstance hazelcastInstance,Properties properties,String mapName){
  this.hazelcastInstance=hazelcastInstance;
  this.properties=properties;
  this.mapName=mapName;
  initCount.incrementAndGet();
}
Program: 50315
Project: 50315
Buggy source:
@Test public void testOneMemberWriteThrough() throws Exception {
  TestMapStore testMapStore=new TestMapStore(1,1,1);
  Config config=newConfig(testMapStore,0);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  Employee employee=new Employee("String_Node_Str",25,true,100.00);
  testMapStore.insert("String_Node_Str",employee);
  IMap map=h1.getMap("String_Node_Str");
  map.addIndex("String_Node_Str",false);
  assertEquals(0,map.size());
  assertEquals(employee,map.get("String_Node_Str"));
  assertEquals(employee,testMapStore.getStore().get("String_Node_Str"));
  assertEquals(1,map.size());
  Collection values=map.values(new SqlPredicate("String_Node_Str"));
  assertEquals(1,values.size());
  assertEquals(employee,values.iterator().next());
}

Fixed version (ground truth):
@Test public void testOneMemberWriteThrough() throws Exception {
  TestMapStore testMapStore=new TestMapStore(1,1,1);
  Config config=newConfig(testMapStore,0);
  HazelcastInstance h1=Hazelcast.newHazelcastInstance(config);
  Employee employee=new Employee("String_Node_Str",25,true,100.00);
  testMapStore.insert("String_Node_Str",employee);
  IMap map=h1.getMap("String_Node_Str");
  map.addIndex("String_Node_Str",false);
  assertEquals(0,map.size());
  assertEquals(employee,map.get("String_Node_Str"));
  assertEquals(employee,testMapStore.getStore().get("String_Node_Str"));
  assertEquals(1,map.size());
  Collection values=map.values(new SqlPredicate("String_Node_Str"));
  assertEquals(1,values.size());
  assertEquals(employee,values.iterator().next());
  map.remove("String_Node_Str");
  map.put("String_Node_Str",employee,1,TimeUnit.SECONDS);
  Thread.sleep(2000);
  assertEquals(employee,testMapStore.getStore().get("String_Node_Str"));
  assertEquals(employee,map.get("String_Node_Str"));
}
Program: 50317
Project: 50317
Buggy source:
public void readFromPacket(DatagramPacket packet){
  ByteArrayInputStream bis=new ByteArrayInputStream(packet.getData(),0,packet.getLength());
  DataInputStream dis=new DataInputStream(bis);
  try {
    setRequest(dis.readBoolean());
    address=new Address();
    address.readData(dis);
    groupName=dis.readUTF();
    groupPassword=dis.readUTF();
    packetVersion=dis.readByte();
    buildNumber=dis.readInt();
    memberCount=dis.readInt();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void readFromPacket(DatagramPacket packet){
  ByteArrayInputStream bis=new ByteArrayInputStream(packet.getData(),0,packet.getLength());
  DataInputStream dis=new DataInputStream(bis);
  try {
    readData(dis);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 50318
Project: 50318
Buggy source:
public void writeToPacket(DatagramPacket packet){
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  try {
    dos.writeBoolean(isRequest());
    address.writeData(dos);
    dos.writeUTF(groupName);
    dos.writeUTF(groupPassword);
    dos.writeByte(Packet.PACKET_VERSION);
    dos.writeInt(buildNumber);
    dos.writeInt(memberCount);
    packet.setData(bos.toByteArray());
    packet.setLength(bos.size());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void writeToPacket(DatagramPacket packet){
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  DataOutputStream dos=new DataOutputStream(bos);
  try {
    writeData(dos);
    packet.setData(bos.toByteArray());
    packet.setLength(bos.size());
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 50320
Project: 50320
Buggy source:
public boolean resume(){
synchronized (lifecycleLock) {
    if (paused.get()) {
      fireLifecycleEvent(new LifecycleEvent(LifecycleEvent.LifecycleState.RESTARTING));
    }
 else {
      return false;
    }
    paused.set(false);
    fireLifecycleEvent(new LifecycleEvent(LifecycleEvent.LifecycleState.RESTARTED));
    return true;
  }
}

Fixed version (ground truth):
public boolean resume(){
synchronized (lifecycleLock) {
    if (paused.get()) {
      fireLifecycleEvent(new LifecycleEvent(LifecycleEvent.LifecycleState.RESUMING));
    }
 else {
      return false;
    }
    paused.set(false);
    fireLifecycleEvent(new LifecycleEvent(LifecycleEvent.LifecycleState.RESUMED));
    return true;
  }
}
Program: 50323
Project: 50323
Buggy source:
private void joinViaRequiredMember(){
  try {
    final Address requiredAddress=getAddressFor(config.getNetworkConfig().getJoin().getTcpIpConfig().getRequiredMember());
    logger.log(Level.FINEST,"String_Node_Str" + requiredAddress);
    if (requiredAddress == null) {
      throw new RuntimeException("String_Node_Str" + config.getNetworkConfig().getJoin().getTcpIpConfig().getRequiredMember());
    }
    if (requiredAddress.equals(address)) {
      setAsMaster();
      return;
    }
    connectionManager.getOrConnect(requiredAddress);
    Connection conn=null;
    while (conn == null) {
      conn=connectionManager.getOrConnect(requiredAddress);
      Thread.sleep(1000);
    }
    while (!joined) {
      final Connection connection=connectionManager.getOrConnect(requiredAddress);
      if (connection == null) {
        joinViaRequiredMember();
      }
      logger.log(Level.FINEST,"String_Node_Str" + requiredAddress);
      clusterManager.sendJoinRequest(requiredAddress);
      Thread.sleep(2000);
    }
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void joinViaRequiredMember(){
  try {
    final Address requiredAddress=getAddressFor(config.getNetworkConfig().getJoin().getTcpIpConfig().getRequiredMember());
    logger.log(Level.FINEST,"String_Node_Str" + requiredAddress);
    if (requiredAddress == null) {
      throw new RuntimeException("String_Node_Str" + config.getNetworkConfig().getJoin().getTcpIpConfig().getRequiredMember());
    }
    if (requiredAddress.equals(address)) {
      setAsMaster();
      return;
    }
    connectionManager.getOrConnect(requiredAddress);
    Connection conn=null;
    while (conn == null) {
      conn=connectionManager.getOrConnect(requiredAddress);
      Thread.sleep(2000L);
    }
    while (!joined) {
      final Connection connection=connectionManager.getOrConnect(requiredAddress);
      if (connection == null) {
        joinViaRequiredMember();
      }
      logger.log(Level.FINEST,"String_Node_Str" + requiredAddress);
      clusterManager.sendJoinRequest(requiredAddress);
      Thread.sleep(3000L);
    }
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}
Program: 50324
Project: 50324
Buggy source:
JoinInfo createJoinInfo(){
  return new JoinInfo(true,address,config.getGroupConfig().getName(),config.getGroupConfig().getPassword(),getLocalNodeType(),Packet.PACKET_VERSION,buildNumber,clusterImpl.getMembers().size());
}

Fixed version (ground truth):
public JoinInfo createJoinInfo(){
  return new JoinInfo(true,address,config.getGroupConfig().getName(),config.getGroupConfig().getPassword(),getLocalNodeType(),Packet.PACKET_VERSION,buildNumber,clusterImpl.getMembers().size());
}
Program: 50325
Project: 50325
Buggy source:
public void start(String[] args) throws Exception {
  if (lineReader == null) {
    lineReader=new DefaultLineReader();
  }
  while (true) {
    print("String_Node_Str" + namespace + "String_Node_Str");
    try {
      final String command=lineReader.readLine();
      handleCommand(command);
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void start(String[] args) throws Exception {
  if (lineReader == null) {
    lineReader=new DefaultLineReader();
  }
  running=true;
  while (running) {
    print("String_Node_Str" + namespace + "String_Node_Str");
    try {
      final String command=lineReader.readLine();
      handleCommand(command);
    }
 catch (    Throwable e) {
      e.printStackTrace();
    }
  }
}