nus-yam/ex-repair huggingface dataset:
Program: 50740
Project: 50740
Buggy source:
@Override void handleNoneRedoResponse(Invocation inv){
  if (request.operation == OP_B_OFFER && inv.responseType == ResponseTypes.RESPONSE_SUCCESS) {
    if (!zeroBackup) {
      if (getPreviousMemberBefore(thisAddress,true,1).getAddress().equals(inv.conn.getEndPoint())) {
        int itemIndex=(int)inv.longValue;
        if (itemIndex != -1) {
          Q q=getQ(request.name);
          if (request.value == null || request.value.size() == 0) {
            throw new RuntimeException("String_Node_Str" + request.value);
          }
          q.doBackup(true,request.value,request.blockId,(int)inv.longValue);
        }
      }
    }
  }
  super.handleNoneRedoResponse(inv);
}

Fixed version (ground truth):
@Override void handleNoneRedoResponse(Invocation inv){
  if (request.operation == OP_B_POLL && inv.responseType == ResponseTypes.RESPONSE_SUCCESS) {
    if (!zeroBackup) {
      if (getPreviousMemberBefore(thisAddress,true,1).getAddress().equals(inv.conn.getEndPoint())) {
        if (inv.value != null) {
          Q q=getQ(inv.name);
          q.doBackup(false,null,request.blockId,0);
        }
      }
    }
  }
  super.handleNoneRedoResponse(inv);
}
Program: 50741
Project: 50741
Buggy source:
public void run(){
  EventTask eventTask=poll();
  if (eventTask == null)   return;
  logger.log(Level.FINE,expectedRecordId + "String_Node_Str" + eventTask.recordId);
  if (expectedRecordId == eventTask.recordId) {
    try {
      eventTask.run();
    }
 catch (    final Throwable e) {
      e.printStackTrace();
    }
    expectedRecordId++;
    while (eventTask != null && mapDelayedEventTasks.size() > 0) {
      eventTask=mapDelayedEventTasks.remove(expectedRecordId);
      if (eventTask != null) {
        eventTask.run();
        expectedRecordId++;
      }
    }
  }
 else   if (eventTask.recordId > expectedRecordId) {
    System.out.println(expectedRecordId + "String_Node_Str" + eventTask.recordId);
    mapDelayedEventTasks.put(eventTask.recordId,eventTask);
  }
}

Fixed version (ground truth):
public void run(){
  try {
    if (!collection) {
      key=ThreadContext.get().toObject(dataKey);
    }
    if (dataValue != null) {
      value=ThreadContext.get().toObject(dataValue);
    }
    ListenerManager.get().callListeners(this);
  }
 catch (  final Exception e) {
    e.printStackTrace();
  }
}
Program: 50742
Project: 50742
Buggy source:
void enqueueEvent(final int eventType,final String name,final Data eventKey,final Data eventValue,final Address from,final long recordId){
  final EventTask eventTask=new EventTask(eventType,name,eventKey,eventValue,recordId);
  if (name.startsWith("String_Node_Str")) {
    OrderedEventQueue orderedEventQueue=mapOrderedEventQueues.get(name);
    if (orderedEventQueue == null) {
      orderedEventQueue=new OrderedEventQueue(recordId);
      mapOrderedEventQueues.put(name,orderedEventQueue);
    }
    logger.log(Level.FINE,eventTask.recordId + "String_Node_Str" + recordId);
    orderedEventQueue.offer(eventTask);
    executeLocally(orderedEventQueue);
  }
 else {
    int eventQueueIndex=-1;
    if (eventKey != null) {
      eventQueueIndex=Math.abs(eventKey.hashCode()) % 100;
    }
 else {
      eventQueueIndex=Math.abs(from.hashCode()) % 100;
    }
    final EventQueue eventQueue=eventQueues[eventQueueIndex];
    final boolean offered=eventQueue.offer(eventTask);
    if (!offered)     throw new RuntimeException("String_Node_Str");
    executeLocally(eventQueue);
  }
}

Fixed version (ground truth):
void enqueueEvent(final int eventType,final String name,final Data eventKey,final Data eventValue,final Address from,final long recordId){
  final EventTask eventTask=new EventTask(eventType,name,eventKey,eventValue,recordId);
  if (name.startsWith("String_Node_Str")) {
    OrderedEventQueue orderedEventQueue=mapOrderedEventQueues.get(name);
    if (orderedEventQueue == null) {
      orderedEventQueue=new OrderedEventQueue(recordId);
      mapOrderedEventQueues.put(name,orderedEventQueue);
    }
    logger.log(Level.FINE,eventTask.recordId + "String_Node_Str" + recordId);
    orderedEventQueue.offer(eventTask);
    executeLocally(orderedEventQueue);
  }
 else {
    int eventQueueIndex=-1;
    if (eventKey != null) {
      eventQueueIndex=Math.abs(eventKey.hashCode()) % EVENT_QUEUE_COUNT;
    }
 else {
      eventQueueIndex=Math.abs(from.hashCode()) % EVENT_QUEUE_COUNT;
    }
    final EventQueue eventQueue=eventQueues[eventQueueIndex];
    final int size=eventQueue.offerRunnable(eventTask);
    if (size == 1)     executeLocally(eventQueue);
  }
}
Program: 50743
Project: 50743
Buggy source:
protected BaseManager(){
  thisAddress=Node.get().address;
  thisMember=Node.get().localMember;
  for (int i=0; i < 100; i++) {
    eventQueues[i]=new EventQueue();
  }
}

Fixed version (ground truth):
protected BaseManager(){
  thisAddress=Node.get().address;
  thisMember=Node.get().localMember;
  for (int i=0; i < EVENT_QUEUE_COUNT; i++) {
    eventQueues[i]=new EventQueue();
  }
}
Program: 50744
Project: 50744
Buggy source:
protected boolean sendResponseFailure(final Invocation inv,final Address address){
  final Connection conn=ConnectionManager.get().getConnection(address);
  inv.conn=conn;
  return sendResponseFailure(inv);
}

Fixed version (ground truth):
protected boolean sendResponseFailure(final Invocation inv,final Address address){
  inv.conn=ConnectionManager.get().getConnection(address);
  return sendResponseFailure(inv);
}
Program: 50747
Project: 50747
Buggy source:
public void doRemoveBlock(Q q,Address originalRemover,int blockId){
  List<Block> lsBlocks=q.lsBlocks;
  Block blockRemoved=q.removeBlock(blockId);
  if (blockRemoved != null) {
    if (isMaster()) {
      sendAddBlockMessageToOthers(blockRemoved,-1,originalRemover,false);
    }
  }
}

Fixed version (ground truth):
public void doRemoveBlock(Q q,Address originalRemover,int blockId){
  Block blockRemoved=q.removeBlock(blockId);
  if (blockRemoved != null) {
    if (isMaster()) {
      sendAddBlockMessageToOthers(blockRemoved,-1,originalRemover,false);
    }
  }
}
Program: 50748
Project: 50748
Buggy source:
public void onExpire(){
  request.response=Boolean.FALSE;
  returnScheduledAsBoolean(request);
}

Fixed version (ground truth):
@Override public void onExpire(){
  request.response=Boolean.FALSE;
  returnScheduledAsBoolean(request);
}
Program: 50749
Project: 50749
Buggy source:
public String[] getValueNames(){
  checkState();
  return (String[])atts.keySet().toArray();
}

Fixed version (ground truth):
public String[] getValueNames(){
  checkState();
  return atts.keySet().toArray(new String[atts.size()]);
}
Program: 50750
Project: 50750
Buggy source:
public synchronized void removeListener(String name,Object listener,Object key){
  Iterator<ListenerItem> it=lsListeners.iterator();
  for (; it.hasNext(); ) {
    ListenerItem listenerItem=it.next();
    if (listener == listenerItem.listener) {
      if (key == null) {
        if (listenerItem.key == null) {
          registerListener(name,null,false,false);
          it.remove();
        }
      }
 else       if (key.equals(listenerItem.key)) {
        registerListener(name,key,false,false);
        it.remove();
      }
    }
  }
}

Fixed version (ground truth):
public synchronized void removeListener(String name,Object listener,Object key){
  Iterator<ListenerItem> it=lsListeners.iterator();
  for (; it.hasNext(); ) {
    ListenerItem listenerItem=it.next();
    if (listener == listenerItem.listener) {
      if (key == null) {
        if (listenerItem.key == null) {
          registerListener(name,null,false,false);
          lsListeners.remove(listenerItem);
        }
      }
 else       if (key.equals(listenerItem.key)) {
        registerListener(name,key,false,false);
        lsListeners.remove(listenerItem);
      }
    }
  }
}
Program: 50751
Project: 50751
Buggy source:
public void setTimeout(long timeout){
  this.timeout=timeout;
  if (timeout > -1) {
    timeToExpire=System.currentTimeMillis() + timeout;
  }
 else   timeout=-1;
}

Fixed version (ground truth):
public void setTimeout(long timeout){
  if (timeout > -1) {
    this.timeout=timeout;
    timeToExpire=System.currentTimeMillis() + timeout;
  }
 else {
    this.timeout=-1;
  }
}
Program: 50752
Project: 50752
Buggy source:
public boolean containsValue(Request req){
  Data value=req.value;
  Collection<Record> records=mapRecords.values();
  for (  Record record : records) {
    if (value.equals(record.getValue()))     return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean containsValue(Request req){
  Data value=req.value;
  Collection<Record> records=mapRecords.values();
  for (  Record record : records) {
    if (record.getValue() == null)     return false;
    if (value.equals(record.getValue()))     return true;
  }
  return false;
}
Program: 50754
Project: 50754
Buggy source:
final void doLock(Request request){
  boolean lock=(request.operation == OP_CMAP_LOCK) ? true : false;
  if (!lock) {
    boolean unlocked=true;
    Record record=recordExist(request);
    if (DEBUG) {
      log(request.operation + "String_Node_Str" + record);
    }
    if (record != null) {
      unlocked=record.unlock(request.lockThreadId,request.lockAddress);
      if (unlocked) {
        sendLockBackup(record);
      }
    }
    if (request.local) {
      if (unlocked)       request.response=Boolean.TRUE;
 else       request.response=Boolean.FALSE;
    }
  }
 else   if (!testLock(request)) {
    if (request.hasEnoughTimeToSchedule()) {
      final Record record=ensureRecord(request);
      final Request reqScheduled=(request.local) ? request : request.softCopy();
      if (request.operation == OP_CMAP_LOCK_RETURN_OLD) {
        reqScheduled.value=ThreadContext.get().hardCopy(record.getValue());
      }
      if (DEBUG) {
        log("String_Node_Str");
      }
      record.addScheduledAction(new ScheduledLockAction(reqScheduled,record));
      request.scheduled=true;
    }
 else {
      request.response=Boolean.FALSE;
    }
  }
 else {
    if (DEBUG) {
      log("String_Node_Str");
    }
    Record rec=ensureRecord(request);
    if (request.operation == OP_CMAP_LOCK_RETURN_OLD) {
      request.value=ThreadContext.get().hardCopy(rec.getValue());
    }
    rec.lock(request.lockThreadId,request.lockAddress);
    sendLockBackup(rec);
    request.response=Boolean.TRUE;
  }
}

Fixed version (ground truth):
final void doLock(Request request){
  boolean lock=(request.operation == OP_CMAP_LOCK || request.operation == OP_CMAP_LOCK_RETURN_OLD) ? true : false;
  if (!lock) {
    boolean unlocked=true;
    Record record=recordExist(request);
    if (DEBUG) {
      log(request.operation + "String_Node_Str" + record);
    }
    if (record != null) {
      unlocked=record.unlock(request.lockThreadId,request.lockAddress);
      if (unlocked) {
        sendLockBackup(record);
      }
    }
    if (request.local) {
      if (unlocked)       request.response=Boolean.TRUE;
 else       request.response=Boolean.FALSE;
    }
  }
 else   if (!testLock(request)) {
    if (request.hasEnoughTimeToSchedule()) {
      final Record record=ensureRecord(request);
      final Request reqScheduled=(request.local) ? request : request.softCopy();
      if (request.operation == OP_CMAP_LOCK_RETURN_OLD) {
        reqScheduled.value=ThreadContext.get().hardCopy(record.getValue());
      }
      if (DEBUG) {
        log("String_Node_Str");
      }
      record.addScheduledAction(new ScheduledLockAction(reqScheduled,record));
      request.scheduled=true;
    }
 else {
      request.response=Boolean.FALSE;
    }
  }
 else {
    if (DEBUG) {
      log("String_Node_Str");
    }
    Record rec=ensureRecord(request);
    if (request.operation == OP_CMAP_LOCK_RETURN_OLD) {
      request.value=ThreadContext.get().hardCopy(rec.getValue());
    }
    rec.lock(request.lockThreadId,request.lockAddress);
    sendLockBackup(rec);
    request.response=Boolean.TRUE;
  }
}
Program: 50755
Project: 50755
Buggy source:
public Object removeIfSame(String name,Object key,Object value,long timeout,long txnId){
  return objectCall(OP_CMAP_REMOVE_IF_SAME,name,key,value,timeout,txnId,-1);
}

Fixed version (ground truth):
public Object removeIfSame(String name,Object key,Object value,long timeout,long txnId){
  return txnalRemove(OP_CMAP_REMOVE_IF_SAME,name,key,value,timeout,txnId);
}
Program: 50756
Project: 50756
Buggy source:
public boolean containsValue(Object value){
  check(value);
  MContainsValue mContainsValue=ConcurrentMapManager.get().new MContainsValue();
  return mContainsValue.containsValue(name,value,-1);
}

Fixed version (ground truth):
public boolean containsValue(Object value){
  check(value);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.containsValue(name,value))     return true;
  }
  MContainsValue mContainsValue=ConcurrentMapManager.get().new MContainsValue();
  return mContainsValue.containsValue(name,value,-1);
}
Program: 50757
Project: 50757
Buggy source:
public boolean containsKey(Object key){
  check(key);
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsKey(name,key,-1);
}

Fixed version (ground truth):
public boolean containsKey(Object key){
  check(key);
  TransactionImpl txn=ThreadContext.get().txn;
  if (txn != null) {
    if (txn.has(name,key)) {
      Object value=txn.get(name,key);
      if (value == null)       return false;
 else       return true;
    }
  }
  MContainsKey mContainsKey=ConcurrentMapManager.get().new MContainsKey();
  return mContainsKey.containsKey(name,key,-1);
}
Program: 50758
Project: 50758
Buggy source:
public Object attachRemoveOp(final String name,final Object key,final Object value,final boolean newRecord){
  TxnRecord rec=findTxnRecord(name,key);
  Object oldValue=null;
  if (rec == null) {
    rec=new TxnRecord(name,key,value,newRecord);
    rec.removed=true;
    lsTxnRecords.add(rec);
    return null;
  }
 else {
    oldValue=rec.value;
    rec.value=value;
  }
  rec.removed=true;
  return oldValue;
}

Fixed version (ground truth):
public Object attachRemoveOp(final String name,final Object key,final Object value,final boolean newRecord){
  TxnRecord rec=findTxnRecord(name,key);
  Object oldValue=null;
  if (rec == null) {
    rec=new TxnRecord(name,key,value,newRecord);
    rec.removed=true;
    lsTxnRecords.add(rec);
  }
 else {
    oldValue=rec.value;
    rec.value=value;
  }
  rec.removed=true;
  return oldValue;
}
Program: 50759
Project: 50759
Buggy source:
public int size(final String name){
  int size=0;
  for (  final TxnRecord txnRecord : lsTxnRecords) {
    if (txnRecord.name.equals(name)) {
      if (txnRecord.removed) {
        if (!txnRecord.newRecord) {
          if (txnRecord.map)           size--;
        }
      }
 else {
        size++;
      }
    }
  }
  return size;
}

Fixed version (ground truth):
public int size(final String name){
  int size=0;
  for (  final TxnRecord txnRecord : lsTxnRecords) {
    if (txnRecord.name.equals(name)) {
      if (txnRecord.removed) {
        if (!txnRecord.newRecord) {
          if (txnRecord.map) {
            size--;
          }
        }
      }
 else {
        size++;
      }
    }
  }
  return size;
}
Program: 50760
Project: 50760
Buggy source:
void registerInvocationProcessor(int operation,InvocationProcessor invocationProcessor){
  if (invProcessors[operation] != null) {
    logger.log(Level.SEVERE,operation + "String_Node_Str" + invProcessors[operation]);
  }
  invProcessors[operation]=invocationProcessor;
}

Fixed version (ground truth):
void registerInvocationProcessor(int operation,InvocationProcessor invocationProcessor){
  if (invocationProcessors[operation] != null) {
    logger.log(Level.SEVERE,operation + "String_Node_Str" + invocationProcessors[operation]);
  }
  invocationProcessors[operation]=invocationProcessor;
}
Program: 50761
Project: 50761
Buggy source:
public void process(final Object obj){
  final long processStart=System.nanoTime();
  if (obj instanceof Invocation) {
    final Invocation inv=(Invocation)obj;
    final MemberImpl memberFrom=ClusterManager.get().getMember(inv.conn.getEndPoint());
    if (memberFrom != null) {
      memberFrom.didRead();
    }
    InvocationProcessor invocationProcessor=invProcessors[inv.operation];
    if (invocationProcessor == null) {
      logger.log(Level.SEVERE,"String_Node_Str" + inv.operation);
    }
    invocationProcessor.process(inv);
  }
 else   if (obj instanceof Processable) {
    ((Processable)obj).process();
  }
 else {
    logger.log(Level.SEVERE,"String_Node_Str" + obj);
  }
  final long processEnd=System.nanoTime();
  final long elipsedTime=processEnd - processStart;
  totalProcessTime+=elipsedTime;
  final long duration=(processEnd - start);
  if (duration > UTILIZATION_CHECK_INTERVAL) {
    if (DEBUG) {
      logger.log(Level.FINEST,"String_Node_Str" + ((totalProcessTime * 100) / duration) + "String_Node_Str");
    }
    start=processEnd;
    totalProcessTime=0;
  }
}

Fixed version (ground truth):
public void process(final Object obj){
  final long processStart=System.nanoTime();
  if (obj instanceof Invocation) {
    final Invocation inv=(Invocation)obj;
    final MemberImpl memberFrom=ClusterManager.get().getMember(inv.conn.getEndPoint());
    if (memberFrom != null) {
      memberFrom.didRead();
    }
    InvocationProcessor invocationProcessor=invocationProcessors[inv.operation];
    if (invocationProcessor == null) {
      logger.log(Level.SEVERE,"String_Node_Str" + inv.operation);
    }
    invocationProcessor.process(inv);
  }
 else   if (obj instanceof Processable) {
    ((Processable)obj).process();
  }
 else {
    logger.log(Level.SEVERE,"String_Node_Str" + obj);
  }
  final long processEnd=System.nanoTime();
  final long elipsedTime=processEnd - processStart;
  totalProcessTime+=elipsedTime;
  final long duration=(processEnd - start);
  if (duration > UTILIZATION_CHECK_INTERVAL) {
    if (DEBUG) {
      logger.log(Level.FINEST,"String_Node_Str" + ((totalProcessTime * 100) / duration) + "String_Node_Str");
    }
    start=processEnd;
    totalProcessTime=0;
  }
}
Program: 50762
Project: 50762
Buggy source:
public SimpleDataEntry(final String name,final int blockId,final Data key,final Data value,final int copyCount){
  super();
  this.blockId=blockId;
  this.keyData=key;
  this.name=name;
  this.valueData=value;
  this.copyCount=copyCount;
}

Fixed version (ground truth):
public SimpleDataEntry(final String name,final Object key,final Object value){
  this.key=key;
  this.value=value;
  this.name=name;
}
Program: 50763
Project: 50763
Buggy source:
public void run(){
  while (running) {
    Object obj=null;
    try {
      lsBuffer.clear();
      queue.drainTo(lsBuffer);
      final int size=lsBuffer.size();
      if (size > 0) {
        for (int i=0; i < size; i++) {
          obj=lsBuffer.get(i);
          checkPeriodics();
          process(obj);
        }
        lsBuffer.clear();
      }
 else {
        obj=queue.poll(100,TimeUnit.MILLISECONDS);
        checkPeriodics();
        if (obj != null) {
          process(obj);
        }
      }
    }
 catch (    final InterruptedException e) {
      Node.get().handleInterruptedException(Thread.currentThread(),e);
    }
catch (    final Throwable e) {
      if (DEBUG) {
        logger.log(Level.FINEST,e + "String_Node_Str" + e+ "String_Node_Str"+ obj);
      }
    }
  }
}

Fixed version (ground truth):
public void run(){
  while (running) {
    Object obj=null;
    try {
      lsBuffer.clear();
      queue.drainTo(lsBuffer);
      final int size=lsBuffer.size();
      if (size > 0) {
        for (int i=0; i < size; i++) {
          obj=lsBuffer.get(i);
          checkPeriodics();
          process(obj);
        }
        lsBuffer.clear();
      }
 else {
        obj=queue.poll(100,TimeUnit.MILLISECONDS);
        checkPeriodics();
        if (obj != null) {
          process(obj);
        }
      }
    }
 catch (    final InterruptedException e) {
      Node.get().handleInterruptedException(Thread.currentThread(),e);
    }
catch (    final Throwable e) {
      if (DEBUG) {
        logger.log(Level.FINEST,e + "String_Node_Str" + e+ "String_Node_Str"+ obj);
        logger.log(Level.FINEST,e.getMessage(),e);
      }
    }
  }
}
Program: 50764
Project: 50764
Buggy source:
public void shutdown(){
  executor.purge();
  executor.shutdownNow();
  eventFireExecutor.shutdownNow();
}

Fixed version (ground truth):
public void shutdown(){
  executor.purge();
  executor.shutdownNow();
}
Program: 50765
Project: 50765
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  Data data=(Data)obj;
  if (data.size != size)   return false;
  int bufferCount=lsData.size();
  if (bufferCount != data.lsData.size())   return false;
  for (int i=0; i < bufferCount; i++) {
    ByteBuffer thisBB=lsData.get(i);
    byte[] thisBuffer=thisBB.array();
    byte[] dataBuffer=data.lsData.get(i).array();
    int limit=thisBB.limit();
    for (int b=0; b < limit; b++) {
      if (thisBuffer[b] != dataBuffer[b])       return false;
    }
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null)   return false;
  if (this == obj)   return true;
  Data data=(Data)obj;
  if (data.size != size)   return false;
  int bufferCount=lsData.size();
  if (bufferCount != data.lsData.size())   return false;
  for (int i=0; i < bufferCount; i++) {
    ByteBuffer thisBB=lsData.get(i);
    byte[] thisBuffer=thisBB.array();
    byte[] dataBuffer=data.lsData.get(i).array();
    int limit=thisBB.limit();
    for (int b=0; b < limit; b++) {
      if (thisBuffer[b] != dataBuffer[b])       return false;
    }
  }
  return true;
}
Program: 50766
Project: 50766
Buggy source:
Address getTarget(String name,Data key){
  int blockId=getBlockId(key);
  Block block=mapBlocks.get(blockId);
  if (block == null) {
    if (isMaster() && !isSuperClient()) {
      block=getOrCreateBlock(blockId);
      block.owner=thisAddress;
    }
 else     return null;
  }
  if (block.owner == null)   return null;
  if (block.owner.equals(thisAddress)) {
    if (block.isMigrating()) {
      if (name == null)       return block.migrationAddress;
      CMap map=getMap(name);
      Record record=map.getRecord(key);
      if (record == null)       return block.migrationAddress;
 else {
        Address recordOwner=record.getOwner();
        if (recordOwner == null)         return thisAddress;
        if ((!recordOwner.equals(thisAddress)) && (!recordOwner.equals(block.migrationAddress))) {
          record.setOwner(thisAddress);
        }
        return record.getOwner();
      }
    }
  }
 else   if (thisAddress.equals(block.migrationAddress)) {
    if (name == null)     return thisAddress;
    CMap map=getMap(name);
    Record record=map.getRecord(key);
    if (record == null)     return thisAddress;
 else     return record.getOwner();
  }
  return block.owner;
}

Fixed version (ground truth):
Address getTarget(String name,Data key){
  int blockId=getBlockId(key);
  Block block=mapBlocks.get(blockId);
  if (block == null) {
    if (isMaster() && !isSuperClient()) {
      block=getOrCreateBlock(blockId);
      block.owner=thisAddress;
    }
 else     return null;
  }
  if (block.isMigrating())   return null;
  if (block.owner == null)   return null;
  if (block.owner.equals(thisAddress)) {
    if (block.isMigrating()) {
      if (name == null)       return block.migrationAddress;
      CMap map=getMap(name);
      Record record=map.getRecord(key);
      if (record == null)       return block.migrationAddress;
 else {
        Address recordOwner=record.getOwner();
        if (recordOwner == null)         return thisAddress;
        if ((!recordOwner.equals(thisAddress)) && (!recordOwner.equals(block.migrationAddress))) {
          record.setOwner(thisAddress);
        }
        return record.getOwner();
      }
    }
  }
 else   if (thisAddress.equals(block.migrationAddress)) {
    if (name == null)     return thisAddress;
    CMap map=getMap(name);
    Record record=map.getRecord(key);
    if (record == null)     return thisAddress;
 else     return record.getOwner();
  }
  return block.owner;
}
Program: 50767
Project: 50767
Buggy source:
private void sendMigrationComplete(){
  for (  MemberImpl member : lsMembers) {
    if (!member.localMember()) {
      Invocation inv=obtainServiceInvocation();
      inv.name="String_Node_Str";
      inv.operation=OP_CMAP_MIGRATION_COMPLETE;
      boolean sent=send(inv,member.getAddress());
      if (!sent) {
        inv.returnToContainer();
      }
    }
  }
}

Fixed version (ground truth):
private void sendMigrationComplete(){
  for (  MemberImpl member : lsMembers) {
    if (!member.localMember()) {
      sendProcessableTo(new MigrationComplete(thisAddress),member.getAddress());
    }
  }
}
Program: 50768
Project: 50768
Buggy source:
private void doMigrationComplete(Address from){
  logger.log(Level.FINEST,"String_Node_Str" + from);
  Collection<Block> blocks=mapBlocks.values();
  for (  Block block : blocks) {
    if (from.equals(block.owner)) {
      if (block.isMigrating()) {
        block.owner=block.migrationAddress;
        block.migrationAddress=null;
      }
    }
  }
  if (isMaster() && !from.equals(thisAddress)) {
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember() || !from.equals(member.getAddress())) {
        Invocation inv=obtainServiceInvocation();
        inv.name="String_Node_Str";
        inv.operation=OP_CMAP_MIGRATION_COMPLETE;
        boolean sent=send(inv,member.getAddress());
        if (!sent) {
          inv.returnToContainer();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void doMigrationComplete(Address from){
  logger.log(Level.FINEST,"String_Node_Str" + from);
  Collection<Block> blocks=mapBlocks.values();
  for (  Block block : blocks) {
    if (from.equals(block.owner)) {
      if (block.isMigrating()) {
        block.owner=block.migrationAddress;
        block.migrationAddress=null;
      }
    }
  }
  if (isMaster() && !from.equals(thisAddress)) {
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember() && !from.equals(member.getAddress())) {
        sendProcessableTo(new MigrationComplete(from),member.getAddress());
      }
    }
  }
}
Program: 50769
Project: 50769
Buggy source:
final private boolean writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    inv.returnToContainer();
    return false;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.currentCallCount=mapCalls.size();
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
  return true;
}

Fixed version (ground truth):
final private boolean writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    return false;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.currentCallCount=mapCalls.size();
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
  return true;
}
Program: 50770
Project: 50770
Buggy source:
public boolean isTerminated(){
  return false;
}

Fixed version (ground truth):
public boolean isTerminated(){
  throw new UnsupportedOperationException();
}
Program: 50771
Project: 50771
Buggy source:
public List invokeAll(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException {
  return null;
}

Fixed version (ground truth):
public List invokeAll(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException {
  throw new UnsupportedOperationException();
}
Program: 50772
Project: 50772
Buggy source:
public boolean awaitTermination(long timeout,TimeUnit unit) throws InterruptedException {
  return false;
}

Fixed version (ground truth):
public boolean awaitTermination(long timeout,TimeUnit unit) throws InterruptedException {
  throw new UnsupportedOperationException();
}
Program: 50773
Project: 50773
Buggy source:
public Object invokeAny(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return null;
}

Fixed version (ground truth):
public Object invokeAny(Collection tasks,long timeout,TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  throw new UnsupportedOperationException();
}
Program: 50774
Project: 50774
Buggy source:
public List<Runnable> shutdownNow(){
  return null;
}

Fixed version (ground truth):
public List<Runnable> shutdownNow(){
  throw new UnsupportedOperationException();
}
Program: 50775
Project: 50775
Buggy source:
public void shutdown(){
}

Fixed version (ground truth):
public void shutdown(){
  throw new UnsupportedOperationException();
}
Program: 50776
Project: 50776
Buggy source:
public boolean isShutdown(){
  return false;
}

Fixed version (ground truth):
public boolean isShutdown(){
  throw new UnsupportedOperationException();
}
Program: 50777
Project: 50777
Buggy source:
final private boolean writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    inv.returnToContainer();
    return false;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
  return true;
}

Fixed version (ground truth):
final private boolean writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    inv.returnToContainer();
    return false;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.currentCallCount=mapCalls.size();
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
  return true;
}
Program: 50778
Project: 50778
Buggy source:
public void reset(){
  name=null;
  operation=-1;
  threadId=-1;
  lockCount=0;
  lockAddress=null;
  timeout=-1;
  txnId=-1;
  responseType=RESPONSE_NONE;
  local=true;
  scheduled=false;
  blockId=-1;
  longValue=Long.MIN_VALUE;
  recordId=-1;
  eventId=-1;
  bbSizes.clear();
  bbHeader.clear();
  key.setNoData();
  data.setNoData();
  attachment=null;
  conn=null;
}

Fixed version (ground truth):
public void reset(){
  name=null;
  operation=-1;
  threadId=-1;
  lockCount=0;
  lockAddress=null;
  timeout=-1;
  txnId=-1;
  responseType=RESPONSE_NONE;
  local=true;
  currentCallCount=0;
  scheduled=false;
  blockId=-1;
  longValue=Long.MIN_VALUE;
  recordId=-1;
  eventId=-1;
  bbSizes.clear();
  bbHeader.clear();
  key.setNoData();
  data.setNoData();
  attachment=null;
  conn=null;
}
Program: 50779
Project: 50779
Buggy source:
public final void enqueueInvocation(final Invocation inv){
  try {
    writeHandlerQueue.put(inv);
  }
 catch (  final InterruptedException e) {
    Node.get().handleInterruptedException(Thread.currentThread(),e);
  }
  if (informSelector.get()) {
    informSelector.set(false);
    final int size=outSelector.addTask(this);
  }
}

Fixed version (ground truth):
public final void enqueueInvocation(final Invocation inv){
  try {
    writeHandlerQueue.put(inv);
  }
 catch (  final InterruptedException e) {
    Node.get().handleInterruptedException(Thread.currentThread(),e);
  }
  if (informSelector.get()) {
    informSelector.set(false);
    outSelector.addTask(this);
    if (inv.currentCallCount < 2) {
      outSelector.selector.wakeup();
    }
  }
}
Program: 50780
Project: 50780
Buggy source:
public final void handle(){
  informSelector.set(true);
  if (writeHandlerQueue.size() == 0) {
    ready=true;
    return;
  }
  if (!connection.live())   return;
  try {
    bbOut.clear();
    copyLoop:     while (bbOut.position() < (32 * 1024)) {
      final Invocation inv=(Invocation)writeHandlerQueue.poll();
      if (inv == null)       break copyLoop;
      inv.write(bbOut);
      doPostWrite(inv);
    }
    if (bbOut.position() == 0)     return;
    bbOut.flip();
    int remaining=bbOut.remaining();
    int loopCount=0;
    connection.didWrite();
    while (remaining > 0) {
      try {
        final int written=socketChannel.write(bbOut);
        remaining-=written;
        loopCount++;
        if (DEBUG) {
          if (loopCount > 1) {
            logger.log(Level.INFO,"String_Node_Str" + loopCount);
          }
        }
      }
 catch (      final Exception e) {
        handleSocketException(e);
        return;
      }
    }
  }
 catch (  final Throwable t) {
    logger.log(Level.INFO,"String_Node_Str" + t);
  }
 finally {
    ready=false;
    registerWrite();
  }
}

Fixed version (ground truth):
public final void handle(){
  if (writeHandlerQueue.size() == 0) {
    ready=true;
    return;
  }
  if (!connection.live())   return;
  try {
    bbOut.clear();
    copyLoop:     while (bbOut.position() < (32 * 1024)) {
      final Invocation inv=(Invocation)writeHandlerQueue.poll();
      if (inv == null)       break copyLoop;
      inv.write(bbOut);
      doPostWrite(inv);
    }
    if (bbOut.position() == 0)     return;
    bbOut.flip();
    int remaining=bbOut.remaining();
    int loopCount=0;
    connection.didWrite();
    while (remaining > 0) {
      try {
        final int written=socketChannel.write(bbOut);
        remaining-=written;
        loopCount++;
        if (DEBUG) {
          if (loopCount > 1) {
            logger.log(Level.INFO,"String_Node_Str" + loopCount);
          }
        }
      }
 catch (      final Exception e) {
        handleSocketException(e);
        return;
      }
    }
  }
 catch (  final Throwable t) {
    logger.log(Level.INFO,"String_Node_Str" + t);
  }
 finally {
    ready=false;
    registerWrite();
  }
}
Program: 50781
Project: 50781
Buggy source:
public final void run(){
  wakeupSelector.set(true);
  informSelector.set(true);
  if (ready) {
    handle();
  }
 else {
    registerWrite();
  }
  ready=false;
}

Fixed version (ground truth):
public final void run(){
  informSelector.set(true);
  if (ready) {
    handle();
  }
 else {
    registerWrite();
  }
  ready=false;
}
Program: 50782
Project: 50782
Buggy source:
public void process(){
  setTarget();
  if (target == null) {
    setResult(OBJECT_REDO);
    return;
  }
  if (target.equals(thisAddress)) {
    doLocalOp();
  }
 else {
    invoke();
  }
}

Fixed version (ground truth):
void process(Invocation inv);
Program: 50783
Project: 50783
Buggy source:
private BlockingQueueManager(){
}

Fixed version (ground truth):
private BlockingQueueManager(){
  ClusterService.get().registerInvocationProcessor(OP_B_POLL,new InvocationProcessor(){
    public void process(    Invocation inv){
      handlePoll(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_OFFER,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleOffer(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_BACKUP_ADD,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleBackup(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_BACKUP_REMOVE,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleBackup(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_PUBLISH,new InvocationProcessor(){
    public void process(    Invocation inv){
      handlePublish(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_ADD_TOPIC_LISTENER,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleAddTopicListener(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_SIZE,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleSize(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_PEEK,new InvocationProcessor(){
    public void process(    Invocation inv){
      handlePoll(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_READ,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleRead(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_REMOVE,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleRemove(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_TXN_BACKUP_POLL,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleTxnBackupPoll(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_TXN_COMMIT,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleTxnCommit(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_ADD_BLOCK,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleAddBlock(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_REMOVE_BLOCK,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleRemoveBlock(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_B_FULL_BLOCK,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleFullBlock(inv);
    }
  }
);
}
Program: 50784
Project: 50784
Buggy source:
private ClusterManager(){
  ConnectionManager.get().addConnectionListener(this);
}

Fixed version (ground truth):
private ClusterManager(){
  ConnectionManager.get().addConnectionListener(this);
  ClusterService.get().registerInvocationProcessor(OP_RESPONSE,new InvocationProcessor(){
    public void process(    Invocation inv){
      handleResponse(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_HEARTBEAT,new InvocationProcessor(){
    public void process(    Invocation inv){
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_REMOTELY_PROCESS_AND_RESPOND,new InvocationProcessor(){
    public void process(    Invocation inv){
      Data data=inv.doTake(inv.data);
      RemotelyProcessable rp=(RemotelyProcessable)ThreadContext.get().toObject(data);
      rp.setConnection(inv.conn);
      rp.process();
      sendResponse(inv);
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_REMOTELY_PROCESS,new InvocationProcessor(){
    public void process(    Invocation inv){
      Data data=inv.doTake(inv.data);
      RemotelyProcessable rp=(RemotelyProcessable)ThreadContext.get().toObject(data);
      rp.setConnection(inv.conn);
      rp.process();
      inv.returnToContainer();
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_REMOTELY_BOOLEAN_CALLABLE,new InvocationProcessor(){
    public void process(    Invocation inv){
      Boolean result=null;
      try {
        Data data=inv.doTake(inv.data);
        AbstractRemotelyCallable<Boolean> callable=(AbstractRemotelyCallable<Boolean>)ThreadContext.get().toObject(data);
        callable.setConnection(inv.conn);
        result=callable.call();
      }
 catch (      Exception e) {
        e.printStackTrace(System.out);
        result=Boolean.FALSE;
      }
      if (result == Boolean.TRUE) {
        sendResponse(inv);
      }
 else {
        sendResponseFailure(inv);
      }
    }
  }
);
  ClusterService.get().registerInvocationProcessor(OP_REMOTELY_OBJECT_CALLABLE,new InvocationProcessor(){
    public void process(    Invocation inv){
      Object result=null;
      try {
        Data data=inv.doTake(inv.data);
        AbstractRemotelyCallable callable=(AbstractRemotelyCallable)ThreadContext.get().toObject(data);
        callable.setConnection(inv.conn);
        result=callable.call();
      }
 catch (      Exception e) {
        e.printStackTrace(System.out);
        result=null;
      }
      if (result != null) {
        Data value=null;
        if (result instanceof Data) {
          value=(Data)result;
        }
 else {
          value=ThreadContext.get().toData(result);
        }
        inv.doSet(value,inv.data);
      }
      sendResponse(inv);
    }
  }
);
}
Program: 50785
Project: 50785
Buggy source:
public void process(final Object obj){
  final long processStart=System.nanoTime();
  if (obj instanceof Invocation) {
    final Invocation inv=(Invocation)obj;
    final MemberImpl memberFrom=ClusterManager.get().getMember(inv.conn.getEndPoint());
    if (memberFrom != null) {
      memberFrom.didRead();
    }
    final int operation=inv.operation;
    if (operation == OP_RESPONSE) {
      ClusterManager.get().handleResponse(inv);
    }
 else     if (operation > 500) {
      ConcurrentMapManager.get().handle(inv);
    }
 else     if (operation > 400) {
      BlockingQueueManager.get().handle(inv);
    }
 else     if (operation > 300) {
      ExecutorManager.get().handle(inv);
    }
 else     if (operation > 200) {
      ListenerManager.get().handle(inv);
    }
 else     if (operation > 0) {
      ClusterManager.get().handle(inv);
    }
 else     throw new RuntimeException("String_Node_Str" + operation);
  }
 else   if (obj instanceof Processable) {
    ((Processable)obj).process();
  }
 else   if (obj instanceof Runnable) {
synchronized (obj) {
      ((Runnable)obj).run();
      obj.notify();
    }
  }
 else   throw new RuntimeException("String_Node_Str" + obj);
  final long processEnd=System.nanoTime();
  final long elipsedTime=processEnd - processStart;
  totalProcessTime+=elipsedTime;
  final long duration=(processEnd - start);
  if (duration > UTILIZATION_CHECK_INTERVAL) {
    if (DEBUG) {
      logger.log(Level.FINEST,"String_Node_Str" + ((totalProcessTime * 100) / duration) + "String_Node_Str");
    }
    start=processEnd;
    totalProcessTime=0;
  }
}

Fixed version (ground truth):
public void process(final Object obj){
  final long processStart=System.nanoTime();
  if (obj instanceof Invocation) {
    final Invocation inv=(Invocation)obj;
    final MemberImpl memberFrom=ClusterManager.get().getMember(inv.conn.getEndPoint());
    if (memberFrom != null) {
      memberFrom.didRead();
    }
    InvocationProcessor invocationProcessor=invProcessors[inv.operation];
    if (invocationProcessor == null) {
      logger.log(Level.SEVERE,"String_Node_Str" + inv.operation);
    }
    invocationProcessor.process(inv);
  }
 else   if (obj instanceof Processable) {
    ((Processable)obj).process();
  }
 else {
    logger.log(Level.SEVERE,"String_Node_Str" + obj);
  }
  final long processEnd=System.nanoTime();
  final long elipsedTime=processEnd - processStart;
  totalProcessTime+=elipsedTime;
  final long duration=(processEnd - start);
  if (duration > UTILIZATION_CHECK_INTERVAL) {
    if (DEBUG) {
      logger.log(Level.FINEST,"String_Node_Str" + ((totalProcessTime * 100) / duration) + "String_Node_Str");
    }
    start=processEnd;
    totalProcessTime=0;
  }
}
Program: 50786
Project: 50786
Buggy source:
final boolean send(final Invocation inv,final Connection conn){
  if (conn != null) {
    writeInvocation(conn,inv);
  }
 else {
    return false;
  }
  return true;
}

Fixed version (ground truth):
final boolean send(final Invocation inv,final Connection conn){
  if (conn != null) {
    return writeInvocation(conn,inv);
  }
 else {
    return false;
  }
}
Program: 50787
Project: 50787
Buggy source:
final private void writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    inv.returnToContainer();
    return;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
}

Fixed version (ground truth):
final private boolean writeInvocation(final Connection conn,final Invocation inv){
  if (!conn.live()) {
    inv.returnToContainer();
    return false;
  }
  final MemberImpl memberImpl=getMember(conn.getEndPoint());
  if (memberImpl != null) {
    memberImpl.didWrite();
  }
  inv.write();
  conn.getWriteHandler().enqueueInvocation(inv);
  return true;
}
Program: 50788
Project: 50788
Buggy source:
final void handleResponse(final Invocation invResponse){
  final Call call=mapCalls.get(invResponse.eventId);
  if (call != null)   call.handleResponse(invResponse);
 else {
    if (DEBUG) {
      log(invResponse.operation + "String_Node_Str" + invResponse.eventId);
    }
    invResponse.returnToContainer();
  }
}

Fixed version (ground truth):
final void handleResponse(final Invocation invResponse){
  final Call call=mapCalls.get(invResponse.eventId);
  if (call != null) {
    call.handleResponse(invResponse);
  }
 else {
    if (DEBUG) {
      log(invResponse.operation + "String_Node_Str" + invResponse.eventId);
    }
    invResponse.returnToContainer();
  }
}
Program: 50790
Project: 50790
Buggy source:
@Override public void doOp(){
  responses.clear();
  enqueueAndReturn(TargetAwareOp.this);
}

Fixed version (ground truth):
@Override public void doOp(){
  responses.clear();
  enqueueAndReturn(ResponseQueueCall.this);
}
Program: 50791
Project: 50791
Buggy source:
public int size(){
  int size=0;
  Collection<Record> records=mapRecords.values();
  for (  Record record : records) {
    if (record.value != null) {
      if (record.owner.equals(thisAddress)) {
        size++;
        size+=record.getCopyCount();
      }
    }
  }
  return size;
}

Fixed version (ground truth):
public int size(){
  int size=0;
  Collection<Record> records=mapRecords.values();
  for (  Record record : records) {
    if (record.value != null) {
      Block block=mapBlocks.get(record.blockId);
      if (thisAddress.equals(block.owner)) {
        size++;
        size+=record.getCopyCount();
      }
    }
  }
  return size;
}
Program: 50792
Project: 50792
Buggy source:
@Override void setTarget(){
}

Fixed version (ground truth):
@Override void setTarget(){
  setTargetBasedOnKey();
}
Program: 50793
Project: 50793
Buggy source:
@Override void doLocalOp(){
}

Fixed version (ground truth):
@Override void doLocalOp(){
  CMap cmap=getMap(request.name);
  total+=cmap.size();
}
Program: 50794
Project: 50794
Buggy source:
@Override public void handleResponse(Invocation inv){
  total+=(int)inv.longValue;
  consumeResponse(inv);
}

Fixed version (ground truth):
public void handleResponse(Invocation inv){
}
Program: 50796
Project: 50796
Buggy source:
private void doMigrationComplete(Address from){
  Collection<Block> blocks=mapBlocks.values();
  for (  Block block : blocks) {
    if (from.equals(block.owner)) {
      if (block.isMigrating()) {
        block.owner=block.migrationAddress;
        block.migrationAddress=null;
      }
    }
  }
  if (isMaster() && !from.equals(thisAddress)) {
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember() || !from.equals(member.getAddress())) {
        Invocation inv=obtainServiceInvocation();
        inv.name="String_Node_Str";
        inv.operation=OP_CMAP_MIGRATION_COMPLETE;
        boolean sent=send(inv,member.getAddress());
        if (!sent) {
          inv.returnToContainer();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void doMigrationComplete(Address from){
  System.out.println("String_Node_Str" + from);
  Collection<Block> blocks=mapBlocks.values();
  for (  Block block : blocks) {
    if (from.equals(block.owner)) {
      if (block.isMigrating()) {
        block.owner=block.migrationAddress;
        block.migrationAddress=null;
      }
    }
  }
  if (isMaster() && !from.equals(thisAddress)) {
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember() || !from.equals(member.getAddress())) {
        Invocation inv=obtainServiceInvocation();
        inv.name="String_Node_Str";
        inv.operation=OP_CMAP_MIGRATION_COMPLETE;
        boolean sent=send(inv,member.getAddress());
        if (!sent) {
          inv.returnToContainer();
        }
      }
    }
  }
}
Program: 50797
Project: 50797
Buggy source:
public int getSize(String name){
  total=0;
  setLocal(OP_CMAP_SIZE,name,null,null,0,-1,-1);
  doOp();
  return total;
}

Fixed version (ground truth):
public int getSize(String name){
  reset();
  shouldRedo=false;
  total=0;
  setLocal(OP_CMAP_SIZE,name,null,null,0,-1,-1);
  doOp();
  if (shouldRedo) {
    try {
      Thread.sleep(2000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
    return getSize(name);
  }
  return total;
}