nus-yam/ex-repair huggingface dataset:
Program: 173063
Project: 173063
Buggy source:
protected void releaseTheBuffers(int id,MPIMessage message){
  if (MPIMessageDirection.IN == message.getMessageDirection()) {
    Queue<MPIBuffer> list=receiveBuffers.get(id);
    for (    MPIBuffer buffer : message.getBuffers()) {
      buffer.getByteBuffer().clear();
      list.offer(buffer);
      receiveBufferReleaseCount++;
    }
  }
 else   if (MPIMessageDirection.OUT == message.getMessageDirection()) {
    Queue<MPIBuffer> queue=sendBuffers;
    for (    MPIBuffer buffer : message.getBuffers()) {
      buffer.getByteBuffer().clear();
      queue.offer(buffer);
      sendBufferReleaseCount++;
    }
  }
}

Fixed version (ground truth):
protected void releaseTheBuffers(int id,MPIMessage message){
  if (MPIMessageDirection.IN == message.getMessageDirection()) {
    Queue<MPIBuffer> list=receiveBuffers.get(id);
    for (    MPIBuffer buffer : message.getBuffers()) {
      buffer.getByteBuffer().clear();
      if (!list.offer(buffer)) {
        throw new RuntimeException("String_Node_Str");
      }
      receiveBufferReleaseCount++;
    }
  }
 else   if (MPIMessageDirection.OUT == message.getMessageDirection()) {
    Queue<MPIBuffer> queue=sendBuffers;
    for (    MPIBuffer buffer : message.getBuffers()) {
      buffer.getByteBuffer().clear();
      if (!queue.offer(buffer)) {
        throw new RuntimeException("String_Node_Str");
      }
      sendBufferReleaseCount++;
    }
  }
}
Program: 173064
Project: 173064
Buggy source:
public boolean sendMessage(int source,Object message,int path,int flags,RoutingParameters routingParameters){
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(source);
  MPIMessage mpiMessage=new MPIMessage(source,type,MPIMessageDirection.OUT,this);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,edge,di,path,flags,routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  return pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(message,sendMessage));
}

Fixed version (ground truth):
public boolean sendMessage(int source,Object message,int path,int flags,RoutingParameters routingParameters){
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(source);
  MPIMessage mpiMessage=new MPIMessage(source,type,MPIMessageDirection.OUT,this);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,edge,di,path,flags,routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  boolean offer=pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(message,sendMessage));
  if (!offer) {
    sendAttempts++;
  }
 else {
    ((TWSMPIChannel)channel).setDebug(false);
    sendAttempts=0;
    sendsOfferred++;
  }
  return offer;
}
Program: 173065
Project: 173065
Buggy source:
public boolean sendMessagePartial(int source,Object object,int path,int flags,RoutingParameters routingParameters){
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(source * -1 - 1);
  MPIMessage mpiMessage=new MPIMessage(source,type,MPIMessageDirection.OUT,this);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,edge,di,path,flags,routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  boolean ret=pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(object,sendMessage));
  return ret;
}

Fixed version (ground truth):
public boolean sendMessagePartial(int source,Object object,int path,int flags,RoutingParameters routingParameters){
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(source * -1 - 1);
  MPIMessage mpiMessage=new MPIMessage(source,type,MPIMessageDirection.OUT,this);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(source,mpiMessage,edge,di,path,flags,routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  boolean ret=pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(object,sendMessage));
  if (!ret) {
    partialSendAttempts++;
  }
 else {
    ((TWSMPIChannel)channel).setDebug(false);
    partialSendAttempts=0;
    sendsPartialOfferred++;
  }
  return ret;
}
Program: 173066
Project: 173066
Buggy source:
/** 
 * Progress the serializations
 */
public void progress(){
  LOG.info(String.format("String_Node_Str",executor,sendCount,receiveCount,sendBufferReleaseCount,receiveBufferReleaseCount));
  if (sendProgressTracker.canProgress()) {
    int sendId=sendProgressTracker.next();
    if (sendId != Integer.MIN_VALUE) {
      sendProgress(pendingSendMessagesPerSource.get(sendId),sendId);
      sendProgressTracker.finish(sendId);
    }
  }
  if (deserializeProgressTracker.canProgress()) {
    int deserializeId=deserializeProgressTracker.next();
    if (deserializeId != Integer.MIN_VALUE) {
      receiveDeserializeProgress(pendingReceiveDeSerializations.get(deserializeId).poll(),deserializeId);
      deserializeProgressTracker.finish(deserializeId);
    }
  }
  if (receiveProgressTracker.canProgress()) {
    int receiveId=receiveProgressTracker.next();
    if (receiveId != Integer.MIN_VALUE) {
      receiveProgress(pendingReceiveMessagesPerSource.get(receiveId));
      receiveProgressTracker.finish(receiveId);
    }
  }
}

Fixed version (ground truth):
/** 
 * Progress the serializations
 */
public void progress(){
  if (partialSendAttempts > 1000000 || sendAttempts > 1000000 || sendCount > 5900) {
    String s="String_Node_Str";
    for (    Map.Entry<Integer,Queue<MPIBuffer>> e : receiveBuffers.entrySet()) {
      s+=e.getKey() + "String_Node_Str" + e.getValue().size()+ "String_Node_Str";
    }
    LOG.info(String.format("String_Node_Str",executor,sendCount,receiveCount,sendBufferReleaseCount,receiveBufferReleaseCount,s,sendsOfferred,sendsPartialOfferred));
    ((TWSMPIChannel)channel).setDebug(true);
  }
  if (sendProgressTracker.canProgress()) {
    int sendId=sendProgressTracker.next();
    if (sendId != Integer.MIN_VALUE) {
      sendProgress(pendingSendMessagesPerSource.get(sendId),sendId);
      sendProgressTracker.finish(sendId);
    }
  }
  if (deserializeProgressTracker.canProgress()) {
    int deserializeId=deserializeProgressTracker.next();
    if (deserializeId != Integer.MIN_VALUE) {
      receiveDeserializeProgress(pendingReceiveDeSerializations.get(deserializeId).poll(),deserializeId);
      deserializeProgressTracker.finish(deserializeId);
    }
  }
  if (receiveProgressTracker.canProgress()) {
    int receiveId=receiveProgressTracker.next();
    if (receiveId != Integer.MIN_VALUE) {
      receiveProgress(pendingReceiveMessagesPerSource.get(receiveId));
      receiveProgressTracker.finish(receiveId);
    }
  }
}
Program: 173067
Project: 173067
Buggy source:
@Override public void progress(){
  delegete.progress();
  if (finalReceiverProgress.compareAndSet(false,true)) {
    finalReceiver.progress();
    finalReceiverProgress.compareAndSet(true,false);
  }
  if (partialRecevierProgress.compareAndSet(false,true)) {
    partialReceiver.progress();
    partialRecevierProgress.compareAndSet(true,false);
  }
}

Fixed version (ground truth):
@Override public void progress(){
  delegete.progress();
  if (lock.tryLock()) {
    try {
      finalReceiver.progress();
    }
  finally {
      lock.unlock();
    }
  }
  if (partialLock.tryLock()) {
    try {
      partialReceiver.progress();
    }
  finally {
      partialLock.unlock();
    }
  }
}
Program: 173068
Project: 173068
Buggy source:
public void finish(int item){
  progressItems.offer(item);
}

Fixed version (ground truth):
public void finish(int item){
  boolean offer=progressItems.offer(item);
  if (!offer) {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 173070
Project: 173070
Buggy source:
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  this.executor=op.getTaskPlan().getThisExecutor();
  this.operation=op;
  this.sendPendingMax=MPIContext.sendPendingMax(cfg);
  this.reducedValues=new ArrayBlockingQueue<>(sendPendingMax);
  for (  Map.Entry<Integer,List<Integer>> e : expectedIds.entrySet()) {
    Map<Integer,List<Object>> messagesPerTask=new HashMap<>();
    Map<Integer,Integer> countsPerTask=new HashMap<>();
    for (    int i : e.getValue()) {
      messagesPerTask.put(i,new ArrayList<Object>());
      countsPerTask.put(i,0);
    }
    LOG.fine(String.format("String_Node_Str",executor,e.getKey(),e.getValue().toString()));
    messages.put(e.getKey(),messagesPerTask);
    counts.put(e.getKey(),countsPerTask);
  }
}

Fixed version (ground truth):
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  this.executor=op.getTaskPlan().getThisExecutor();
  this.operation=op;
  this.sendPendingMax=MPIContext.sendPendingMax(cfg);
  this.reducedValues=new ArrayBlockingQueue<>(sendPendingMax);
  for (  Map.Entry<Integer,List<Integer>> e : expectedIds.entrySet()) {
    Map<Integer,List<Object>> messagesPerTask=new HashMap<>();
    Map<Integer,Integer> countsPerTask=new HashMap<>();
    Map<Integer,Integer> totalCountsPerTask=new HashMap<>();
    for (    int i : e.getValue()) {
      messagesPerTask.put(i,new ArrayList<Object>());
      countsPerTask.put(i,0);
      totalCountsPerTask.put(i,0);
    }
    LOG.fine(String.format("String_Node_Str",executor,e.getKey(),e.getValue().toString()));
    messages.put(e.getKey(),messagesPerTask);
    counts.put(e.getKey(),countsPerTask);
    totalCounts.put(e.getKey(),totalCountsPerTask);
  }
}
Program: 173071
Project: 173071
Buggy source:
@Override public boolean onMessage(int source,int path,int target,int flags,Object object){
  boolean canAdd=true;
  List<Object> m=messages.get(target).get(source);
  Integer c=counts.get(target).get(source);
  if (m.size() > sendPendingMax) {
    canAdd=false;
  }
 else {
    m.add(object);
    counts.get(target).put(source,c + 1);
  }
  return canAdd;
}

Fixed version (ground truth):
@Override public boolean onMessage(int source,int path,int target,int flags,Object object){
  boolean canAdd=true;
  List<Object> m=messages.get(target).get(source);
  Integer c=counts.get(target).get(source);
  if (m.size() > sendPendingMax * 4) {
    canAdd=false;
    onMessageAttempts++;
  }
 else {
    onMessageAttempts=0;
    m.add(object);
    counts.get(target).put(source,c + 1);
    Integer tc=totalCounts.get(target).get(source);
    totalCounts.get(target).put(source,tc + 1);
  }
  return canAdd;
}
Program: 173072
Project: 173072
Buggy source:
@Override public void progress(){
  for (  int t : messages.keySet()) {
    boolean canProgress=true;
    Map<Integer,List<Object>> messagePerTarget=messages.get(t);
    Map<Integer,Integer> countsPerTarget=counts.get(t);
    while (canProgress) {
      boolean found=true;
      for (      Map.Entry<Integer,List<Object>> e : messagePerTarget.entrySet()) {
        if (e.getValue().size() == 0) {
          found=false;
          canProgress=false;
        }
      }
      if (found && reducedValues.size() < sendPendingMax) {
        Object previous=null;
        for (        Map.Entry<Integer,List<Object>> e : messagePerTarget.entrySet()) {
          if (previous == null) {
            previous=e.getValue().remove(0);
          }
 else {
            Object current=e.getValue().remove(0);
            previous=reduceFunction.reduce(previous,current);
          }
        }
        if (previous != null) {
          reducedValues.offer(previous);
        }
      }
      if (reducedValues.size() > 0) {
        Object previous=reducedValues.peek();
        boolean handle=handleMessage(t,previous,0,destination);
        if (handle) {
          reducedValues.poll();
          for (          Map.Entry<Integer,Integer> e : countsPerTarget.entrySet()) {
            Integer i=e.getValue();
            countsPerTarget.put(e.getKey(),i - 1);
          }
        }
 else {
          canProgress=false;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void progress(){
  for (  int t : messages.keySet()) {
    boolean canProgress=true;
    Map<Integer,List<Object>> messagePerTarget=messages.get(t);
    Map<Integer,Integer> countsPerTarget=counts.get(t);
    Map<Integer,Integer> totalCountMap=totalCounts.get(t);
    while (canProgress) {
      boolean found=true;
      for (      Map.Entry<Integer,List<Object>> e : messagePerTarget.entrySet()) {
        if (e.getValue().size() == 0) {
          found=false;
          canProgress=false;
        }
      }
      if (found && reducedValues.size() < sendPendingMax) {
        Object previous=null;
        for (        Map.Entry<Integer,List<Object>> e : messagePerTarget.entrySet()) {
          if (previous == null) {
            previous=e.getValue().remove(0);
          }
 else {
            Object current=e.getValue().remove(0);
            previous=reduceFunction.reduce(previous,current);
          }
        }
        if (previous != null) {
          reducedValues.offer(previous);
        }
      }
 else {
        progressAttempts++;
      }
      if (reducedValues.size() > 0) {
        Object previous=reducedValues.peek();
        boolean handle=handleMessage(t,previous,0,destination);
        if (handle) {
          reducedValues.poll();
          for (          Map.Entry<Integer,Integer> e : countsPerTarget.entrySet()) {
            Integer i=e.getValue();
            countsPerTarget.put(e.getKey(),i - 1);
          }
        }
 else {
          canProgress=false;
        }
      }
    }
  }
}
Program: 173073
Project: 173073
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    IntData data=generateData();
    for (int i=0; i < 1000; i++) {
      int flag=0;
      if (i == 1000 - 1) {
        flag=MessageFlags.FLAGS_LAST;
      }
      while (!reduce.send(task,data,flag)) {
        reduce.progress();
      }
      if (i % 100 == 0) {
        LOG.info(String.format("String_Node_Str",id,i));
      }
      Thread.yield();
    }
    LOG.info(String.format("String_Node_Str",id));
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    IntData data=generateData();
    for (int i=0; i < 1000; i++) {
      int flag=0;
      if (i == 1000 - 1) {
        flag=MessageFlags.FLAGS_LAST;
      }
      while (!reduce.send(task,data,flag)) {
        reduce.progress();
        Thread.yield();
      }
      if (i % 100 == 0) {
        LOG.info(String.format("String_Node_Str",id,i));
      }
      Thread.yield();
    }
    LOG.info(String.format("String_Node_Str",id));
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}
Program: 173074
Project: 173074
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    IntData data=generateData();
    for (int i=0; i < 6000; i++) {
      while (!reduce.send(task,data,0)) {
        reduce.progress();
      }
      if (i % 100 == 0) {
        LOG.info(String.format("String_Node_Str",id,i));
      }
    }
    LOG.info(String.format("String_Node_Str",id));
    status=Status.MAP_FINISHED;
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    IntData data=generateData();
    for (int i=0; i < 6000; i++) {
      while (!reduce.send(task,data,0)) {
        reduce.progress();
        Thread.yield();
      }
      if (i % 100 == 0) {
        LOG.info(String.format("String_Node_Str",id,i));
      }
    }
    LOG.info(String.format("String_Node_Str",id));
    status=Status.MAP_FINISHED;
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}
Program: 173075
Project: 173075
Buggy source:
/** 
 * The destination id is the destination itself
 * @return
 */
public int destinationIdentifier(int source,int path){
  return 0;
}

Fixed version (ground truth):
/** 
 * The destination id is the destination itself
 */
public int destinationIdentifier(int source,int path){
  return 0;
}
Program: 173076
Project: 173076
Buggy source:
/** 
 * Create a direct router
 * @param plan
 * @param srscs
 * @param dests
 */
public PartitionRouter(TaskPlan plan,Set<Integer> srscs,Set<Integer> dests){
  this.taskPlan=plan;
  this.externalSendTasks=new HashMap<>();
  this.internalSendTasks=new HashMap<>();
  Set<Integer> myTasks=taskPlan.getChannelsOfExecutor(taskPlan.getThisExecutor());
  for (  int src : srscs) {
    if (myTasks.contains(src)) {
      for (      int dest : dests) {
        if (myTasks.contains(dest)) {
          Set<Integer> set=new HashSet<>();
          set.add(dest);
          internalSendTasks.put(src,set);
        }
 else {
          Set<Integer> set=new HashSet<>();
          set.add(dest);
          externalSendTasks.put(src,set);
        }
      }
    }
  }
  this.upstream=new HashMap<>();
  List<Integer> sources=new ArrayList<>();
  sources.addAll(srscs);
  for (  int dest : dests) {
    if (myTasks.contains(dest)) {
      this.upstream.put(dest,sources);
    }
  }
  receiveExecutors=PartitionRouter.getExecutorsHostingTasks(plan,srscs);
  receiveExecutors.remove(taskPlan.getThisExecutor());
  this.thisExecutorTasks=taskPlan.getChannelsOfExecutor(taskPlan.getThisExecutor());
}

Fixed version (ground truth):
/** 
 * Create a direct router
 */
public PartitionRouter(TaskPlan plan,Set<Integer> srscs,Set<Integer> dests){
  this.taskPlan=plan;
  this.externalSendTasks=new HashMap<>();
  this.internalSendTasks=new HashMap<>();
  Set<Integer> myTasks=taskPlan.getChannelsOfExecutor(taskPlan.getThisExecutor());
  for (  int src : srscs) {
    if (myTasks.contains(src)) {
      for (      int dest : dests) {
        if (myTasks.contains(dest)) {
          if (!internalSendTasks.containsKey(src)) {
            Set<Integer> set=new HashSet<>();
            set.add(dest);
            internalSendTasks.put(src,set);
          }
 else {
            internalSendTasks.get(src).add(dest);
          }
        }
 else {
          if (!externalSendTasks.containsKey(src)) {
            Set<Integer> set=new HashSet<>();
            set.add(dest);
            externalSendTasks.put(src,set);
          }
 else {
            externalSendTasks.get(src).add(dest);
          }
        }
      }
    }
  }
  this.upstream=new HashMap<>();
  List<Integer> sources=new ArrayList<>();
  sources.addAll(srscs);
  for (  int dest : dests) {
    if (myTasks.contains(dest)) {
      this.upstream.put(dest,sources);
    }
  }
  receiveExecutors=PartitionRouter.getExecutorsHostingTasks(plan,srscs);
  receiveExecutors.remove(taskPlan.getThisExecutor());
  this.thisExecutorTasks=taskPlan.getChannelsOfExecutor(taskPlan.getThisExecutor());
}
Program: 173077
Project: 173077
Buggy source:
public static Object deserializeData(List<MPIBuffer> buffers,int length,KryoSerializer serializer,MessageType type){
switch (type) {
case INTEGER:
    return deserializeInteger(buffers,length);
case DOUBLE:
  return deserializeDouble(buffers,length);
case SHORT:
return deserializeShort(buffers,length);
case OBJECT:
return deserializeObject(buffers,length,serializer);
default :
break;
}
return null;
}

Fixed version (ground truth):
public static Object deserializeData(List<MPIBuffer> buffers,int length,KryoSerializer serializer,MessageType type){
switch (type) {
case INTEGER:
    return deserializeInteger(buffers,length);
case DOUBLE:
  return deserializeDouble(buffers,length);
case SHORT:
return deserializeShort(buffers,length);
case BYTE:
return deserializeBytes(buffers,length);
case OBJECT:
return deserializeObject(buffers,length,serializer);
default :
break;
}
return null;
}
Program: 173078
Project: 173078
Buggy source:
public static Object deserializeValue(ByteBuffer value,DataMessageType valueType,KryoMemorySerializer serializer){
switch (valueType) {
case INTEGER:
    return deserializeInteger(value);
case DOUBLE:
  return deserializeDouble(value);
case SHORT:
return deserializeShort(value);
case BYTE:
byte[] bytes=new byte[value.remaining()];
value.get(bytes);
return bytes;
case OBJECT:
return deserializeObject(value,serializer);
default :
break;
}
return null;
}

Fixed version (ground truth):
public static Object deserializeValue(ByteBuffer value,DataMessageType valueType,KryoMemorySerializer serializer){
switch (valueType) {
case INTEGER:
    return deserializeInteger(value);
case DOUBLE:
  return deserializeDouble(value);
case SHORT:
return deserializeShort(value);
case BYTE:
return deserializeBytes(value,serializer);
case OBJECT:
return deserializeObject(value,serializer);
default :
break;
}
return null;
}
Program: 173079
Project: 173079
Buggy source:
public static Object deserializeObject(ByteBuffer data,KryoMemorySerializer serializer){
  int length=data.getInt();
  if (length != data.remaining()) {
    throw new RuntimeException("String_Node_Str");
  }
  byte[] temp=new byte[data.remaining()];
  data.get(temp);
  return serializer.deserialize(temp);
}

Fixed version (ground truth):
public static Object deserializeObject(ByteBuffer data,KryoMemorySerializer serializer){
  int length=data.getInt();
  List<Object> dataList=new ArrayList<>();
  while (data.remaining() > 4) {
    if (length > data.remaining()) {
      throw new RuntimeException("String_Node_Str");
    }
    byte[] temp=new byte[length];
    data.get(temp);
    dataList.add(serializer.deserialize(temp));
  }
  return dataList;
}
Program: 173080
Project: 173080
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public void receive(int target,Iterator<Object> it){
  int itercount=0;
  Object temp;
  while (it.hasNext()) {
    itercount++;
    temp=it.next();
    if (temp instanceof ImmutablePair) {
      ImmutablePair<Object,Object> data=(ImmutablePair<Object,Object>)temp;
      LOG.info("String_Node_Str" + ByteBuffer.wrap((byte[])data.getKey()).getInt() + "String_Node_Str"+ Arrays.toString((int[])data.getValue()));
    }
  }
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public void receive(int target,Iterator<Object> it){
  int itercount=0;
  Object temp;
  while (it.hasNext()) {
    itercount++;
    temp=it.next();
    if (temp instanceof ImmutablePair) {
      ImmutablePair<Object,Object> data=(ImmutablePair<Object,Object>)temp;
      if (data.getValue() instanceof List) {
        byte[] tempData=(byte[])((List)data.getValue()).get(0);
        LOG.info("String_Node_Str" + ByteBuffer.wrap((byte[])data.getKey()).getInt() + "String_Node_Str"+ Arrays.toString(tempData));
      }
 else {
        LOG.info("String_Node_Str" + ByteBuffer.wrap((byte[])data.getKey()).getInt() + "String_Node_Str"+ Arrays.toString((byte[])data.getValue()));
      }
    }
  }
}
Program: 173081
Project: 173081
Buggy source:
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    startTime=System.nanoTime();
    for (int i=0; i < 1; i++) {
      int[] data={task,task * 100};
      int keyint=task * 111;
      byte[] key=ByteBuffer.allocate(4).putInt(keyint).array();
      int flags=MessageFlags.FLAGS_LAST;
      KeyedContent mesage=new KeyedContent(key,data,MessageType.BYTE,MessageType.INTEGER);
      while (!aggregate.send(task,mesage,flags)) {
        try {
          Thread.sleep(1);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      Thread.yield();
    }
    LOG.info(String.format("String_Node_Str",id));
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    LOG.log(Level.INFO,"String_Node_Str" + id);
    startTime=System.nanoTime();
    for (int i=0; i < 1; i++) {
      byte[] data=new byte[12];
      data[0]='a';
      data[1]='b';
      data[2]='c';
      data[3]='d';
      data[4]='d';
      data[5]='d';
      data[6]='d';
      data[7]='d';
      int keyint=task * 111;
      byte[] key=ByteBuffer.allocate(4).putInt(keyint).array();
      int flags=MessageFlags.FLAGS_LAST;
      KeyedContent mesage=new KeyedContent(key,data,MessageType.BYTE,MessageType.BYTE);
      while (!aggregate.send(task,mesage,flags)) {
        try {
          Thread.sleep(1);
        }
 catch (        InterruptedException e) {
          e.printStackTrace();
        }
      }
      Thread.yield();
    }
    LOG.info(String.format("String_Node_Str",id));
  }
 catch (  Throwable t) {
    t.printStackTrace();
  }
}
Program: 173082
Project: 173082
Buggy source:
/** 
 * Serialize the message object and send it to store
 * @param mpiSendMessage mpi send message that has information
 * @param messageObject object to be sent
 */
private boolean serializeAndWriteToMemoryManager(MPISendMessage mpiSendMessage,Object messageObject){
  if (isKeyed) {
    KeyedContent kc=(KeyedContent)messageObject;
    ByteBuffer keyBuffer=KeySerializer.getserializedKey(kc.getSource(),mpiSendMessage.getSerializationState(),keyType,kryoSerializer);
    ByteBuffer dataBuffer=DataSerializer.getserializedData(kc.getObject(),type,kryoSerializer);
    return operationMemoryManager.put(keyBuffer,dataBuffer);
  }
 else {
    int key=mpiSendMessage.getSource();
    ByteBuffer keyBuffer=ByteBuffer.allocateDirect(Integer.BYTES);
    keyBuffer.putInt(key);
    ByteBuffer dataBuffer=DataSerializer.getserializedData(messageObject,type,kryoSerializer);
    return operationMemoryManager.put(keyBuffer,dataBuffer);
  }
}

Fixed version (ground truth):
/** 
 * Serialize the message object and send it to store
 * @param mpiSendMessage mpi send message that has information
 * @param messageObject object to be sent
 */
private boolean serializeAndWriteToMemoryManager(MPISendMessage mpiSendMessage,Object messageObject){
  if (mpiSendMessage.getSerializationState() == null) {
    mpiSendMessage.setSerializationState(new SerializeState());
  }
  if (isKeyed) {
    KeyedContent kc=(KeyedContent)messageObject;
    ByteBuffer keyBuffer=KeySerializer.getserializedKey(kc.getSource(),mpiSendMessage.getSerializationState(),keyType,kryoSerializer);
    ByteBuffer dataBuffer=DataSerializer.getserializedData(kc.getObject(),type,kryoSerializer);
    return operationMemoryManager.put(keyBuffer,dataBuffer);
  }
 else {
    int key=mpiSendMessage.getSource();
    ByteBuffer keyBuffer=ByteBuffer.allocateDirect(Integer.BYTES);
    keyBuffer.putInt(key);
    ByteBuffer dataBuffer=DataSerializer.getserializedData(messageObject,type,kryoSerializer);
    return operationMemoryManager.put(keyBuffer,dataBuffer);
  }
}
Program: 173083
Project: 173083
Buggy source:
@Override public Object getDataBuffers(Object partialObject,int edge){
  MPIMessage currentMessage=(MPIMessage)partialObject;
  int readLength=0;
  int bufferIndex=0;
  List<MPIBuffer> buffers=currentMessage.getBuffers();
  List<Object> returnList=new ArrayList<>();
  MessageHeader header=currentMessage.getHeader();
  if (header == null) {
    throw new RuntimeException("String_Node_Str");
  }
  while (readLength < header.getLength()) {
    List<MPIBuffer> messageBuffers=new ArrayList<>();
    MPIBuffer mpiBuffer=buffers.get(bufferIndex);
    ByteBuffer byteBuffer=mpiBuffer.getByteBuffer();
    int length=byteBuffer.getInt();
    int tempLength=0;
    int tempBufferIndex=bufferIndex;
    while (tempLength < length) {
      mpiBuffer=buffers.get(tempBufferIndex);
      messageBuffers.add(mpiBuffer);
      tempLength+=mpiBuffer.getByteBuffer().remaining();
      tempBufferIndex++;
    }
    Object object=getSingleDataBuffers(currentMessage,messageBuffers,length);
    readLength+=length + 4;
    byteBuffer=mpiBuffer.getByteBuffer();
    if (byteBuffer.remaining() > 0) {
      bufferIndex=tempBufferIndex - 1;
    }
 else {
      bufferIndex=tempBufferIndex;
    }
    returnList.add(object);
  }
  return returnList;
}

Fixed version (ground truth):
@Override public Object getDataBuffers(Object partialObject,int edge){
  MPIMessage currentMessage=(MPIMessage)partialObject;
  int readLength=0;
  int bufferIndex=0;
  List<MPIBuffer> buffers=currentMessage.getBuffers();
  List<Object> returnList=new ArrayList<>();
  MessageHeader header=currentMessage.getHeader();
  if (header == null) {
    throw new RuntimeException("String_Node_Str");
  }
  while (readLength < header.getLength()) {
    List<MPIBuffer> messageBuffers=new ArrayList<>();
    MPIBuffer mpiBuffer=buffers.get(bufferIndex);
    ByteBuffer byteBuffer=mpiBuffer.getByteBuffer();
    int length=byteBuffer.getInt();
    int tempLength=0;
    int tempBufferIndex=bufferIndex;
    while (tempLength < length) {
      mpiBuffer=buffers.get(tempBufferIndex);
      messageBuffers.add(mpiBuffer);
      tempLength+=mpiBuffer.getByteBuffer().remaining();
      tempBufferIndex++;
    }
    Object object=getSingleDataBuffers(currentMessage,messageBuffers,length);
    readLength+=length + 4;
    if (keyed) {
      readLength+=4;
    }
    byteBuffer=mpiBuffer.getByteBuffer();
    if (byteBuffer.remaining() > 0) {
      bufferIndex=tempBufferIndex - 1;
    }
 else {
      bufferIndex=tempBufferIndex;
    }
    returnList.add(object);
  }
  return returnList;
}
Program: 173084
Project: 173084
Buggy source:
@Override public Object build(Object partialObject,int edge){
  MPIMessage currentMessage=(MPIMessage)partialObject;
  int readLength=0;
  int bufferIndex=0;
  List<MPIBuffer> buffers=currentMessage.getBuffers();
  List<Object> returnList=new ArrayList<>();
  MessageHeader header=currentMessage.getHeader();
  if (header == null) {
    throw new RuntimeException("String_Node_Str");
  }
  while (readLength < header.getLength()) {
    List<MPIBuffer> messageBuffers=new ArrayList<>();
    MPIBuffer mpiBuffer=buffers.get(bufferIndex);
    ByteBuffer byteBuffer=mpiBuffer.getByteBuffer();
    int length=byteBuffer.getInt();
    int tempLength=0;
    int tempBufferIndex=bufferIndex;
    while (tempLength < length) {
      mpiBuffer=buffers.get(tempBufferIndex);
      messageBuffers.add(mpiBuffer);
      tempLength+=mpiBuffer.getByteBuffer().remaining();
      tempBufferIndex++;
    }
    Object object=buildMessage(currentMessage,messageBuffers,length);
    readLength+=length + 4;
    byteBuffer=mpiBuffer.getByteBuffer();
    if (byteBuffer.remaining() > 0) {
      bufferIndex=tempBufferIndex - 1;
    }
 else {
      bufferIndex=tempBufferIndex;
    }
    returnList.add(object);
  }
  return returnList;
}

Fixed version (ground truth):
@Override public Object build(Object partialObject,int edge){
  MPIMessage currentMessage=(MPIMessage)partialObject;
  int readLength=0;
  int bufferIndex=0;
  List<MPIBuffer> buffers=currentMessage.getBuffers();
  List<Object> returnList=new ArrayList<>();
  MessageHeader header=currentMessage.getHeader();
  if (header == null) {
    throw new RuntimeException("String_Node_Str");
  }
  while (readLength < header.getLength()) {
    List<MPIBuffer> messageBuffers=new ArrayList<>();
    MPIBuffer mpiBuffer=buffers.get(bufferIndex);
    ByteBuffer byteBuffer=mpiBuffer.getByteBuffer();
    int length=byteBuffer.getInt();
    int tempLength=0;
    int tempBufferIndex=bufferIndex;
    while (tempLength < length) {
      mpiBuffer=buffers.get(tempBufferIndex);
      messageBuffers.add(mpiBuffer);
      tempLength+=mpiBuffer.getByteBuffer().remaining();
      tempBufferIndex++;
    }
    Object object=buildMessage(currentMessage,messageBuffers,length);
    readLength+=length + 4;
    if (keyed) {
      readLength+=4;
    }
    byteBuffer=mpiBuffer.getByteBuffer();
    if (byteBuffer.remaining() > 0) {
      bufferIndex=tempBufferIndex - 1;
    }
 else {
      bufferIndex=tempBufferIndex;
    }
    returnList.add(object);
  }
  return returnList;
}
Program: 173085
Project: 173085
Buggy source:
private static byte[] readBytes(List<MPIBuffer> buffers,int length){
  byte[] bytes=new byte[length];
  int currentRead=0;
  int index=0;
  while (currentRead < length) {
    ByteBuffer byteBuffer=buffers.get(index).getByteBuffer();
    int remaining=byteBuffer.remaining();
    int needRead=length - currentRead;
    int canRead=remaining > needRead ? needRead : remaining;
    byteBuffer.get(bytes,currentRead,canRead);
    currentRead+=canRead;
    index++;
    if (index >= buffers.size()) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return bytes;
}

Fixed version (ground truth):
private static byte[] readBytes(List<MPIBuffer> buffers,int length){
  byte[] bytes=new byte[length];
  int currentRead=0;
  int index=0;
  while (currentRead < length) {
    ByteBuffer byteBuffer=buffers.get(index).getByteBuffer();
    int remaining=byteBuffer.remaining();
    int needRead=length - currentRead;
    int canRead=remaining > needRead ? needRead : remaining;
    byteBuffer.get(bytes,currentRead,canRead);
    currentRead+=canRead;
    index++;
    if (currentRead < length && index >= buffers.size()) {
      throw new RuntimeException("String_Node_Str");
    }
  }
  return bytes;
}
Program: 173086
Project: 173086
Buggy source:
public static Object deserializeValue(ByteBuffer value,DataMessageType valueType,KryoMemorySerializer serializer){
switch (valueType) {
case INTEGER:
    return deserializeInteger(value);
case DOUBLE:
  return deserializeDouble(value);
case SHORT:
return deserializeShort(value);
case OBJECT:
return deserializeObject(value,serializer);
default :
break;
}
return null;
}

Fixed version (ground truth):
public static Object deserializeValue(ByteBuffer value,DataMessageType valueType,KryoMemorySerializer serializer){
switch (valueType) {
case INTEGER:
    return deserializeInteger(value);
case DOUBLE:
  return deserializeDouble(value);
case SHORT:
return deserializeShort(value);
case BYTE:
byte[] bytes=new byte[value.remaining()];
value.get(bytes);
return bytes;
case OBJECT:
return deserializeObject(value,serializer);
default :
break;
}
return null;
}
Program: 173087
Project: 173087
Buggy source:
public static Object deserializeKey(ByteBuffer key,DataMessageType keyType,KryoMemorySerializer serializer){
switch (keyType) {
case INTEGER:
    return key.getInt();
case DOUBLE:
  return key.getDouble();
case SHORT:
return key.getShort();
case OBJECT:
byte[] temp=new byte[key.remaining()];
key.get(temp);
return serializer.deserialize(temp);
default :
break;
}
return null;
}

Fixed version (ground truth):
public static Object deserializeKey(ByteBuffer key,DataMessageType keyType,KryoMemorySerializer serializer){
switch (keyType) {
case INTEGER:
    return key.getInt();
case DOUBLE:
  return key.getDouble();
case SHORT:
return key.getShort();
case BYTE:
byte[] bytes=new byte[key.remaining()];
key.get(bytes);
return bytes;
case OBJECT:
byte[] temp=new byte[key.remaining()];
key.get(temp);
return serializer.deserialize(temp);
default :
break;
}
return null;
}
Program: 173088
Project: 173088
Buggy source:
private static Thread createAsyncStreamThread(final InputStream input,final StringBuilder processOutputStringBuilder,final boolean isVerbose){
  Thread thread=new Thread(){
    @Override public void run(){
      LOG.log(Level.FINE,"String_Node_Str");
      BufferedReader reader=new BufferedReader(new InputStreamReader(input),1);
      while (true) {
        String line=null;
        try {
          line=reader.readLine();
        }
 catch (        IOException e) {
          LOG.log(Level.SEVERE,"String_Node_Str",e);
        }
        if (line == null) {
          break;
        }
 else {
          System.err.println(line);
          if (processOutputStringBuilder != null) {
            processOutputStringBuilder.append(line);
          }
        }
      }
      try {
        input.close();
      }
 catch (      IOException e) {
        LOG.log(Level.WARNING,"String_Node_Str",e);
      }
    }
  }
;
  thread.setDaemon(true);
  return thread;
}

Fixed version (ground truth):
private static Thread createAsyncStreamThread(final InputStream input,final StringBuilder processOutputStringBuilder,final boolean isVerbose){
  Thread thread=new Thread(){
    @Override public void run(){
      LOG.log(Level.FINE,"String_Node_Str");
      BufferedReader reader=new BufferedReader(new InputStreamReader(input),1);
      while (true) {
        String line=null;
        try {
          line=reader.readLine();
        }
 catch (        IOException e) {
          LOG.log(Level.SEVERE,"String_Node_Str",e);
        }
        if (line == null) {
          break;
        }
 else {
          System.err.println(line);
        }
      }
      try {
        input.close();
      }
 catch (      IOException e) {
        LOG.log(Level.WARNING,"String_Node_Str",e);
      }
    }
  }
;
  thread.setDaemon(true);
  return thread;
}
Program: 173089
Project: 173089
Buggy source:
@Override public void run(){
  LOG.log(Level.FINE,"String_Node_Str");
  BufferedReader reader=new BufferedReader(new InputStreamReader(input),1);
  while (true) {
    String line=null;
    try {
      line=reader.readLine();
    }
 catch (    IOException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
    }
    if (line == null) {
      break;
    }
 else {
      System.err.println(line);
      if (processOutputStringBuilder != null) {
        processOutputStringBuilder.append(line);
      }
    }
  }
  try {
    input.close();
  }
 catch (  IOException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  LOG.log(Level.FINE,"String_Node_Str");
  BufferedReader reader=new BufferedReader(new InputStreamReader(input),1);
  while (true) {
    String line=null;
    try {
      line=reader.readLine();
    }
 catch (    IOException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
    }
    if (line == null) {
      break;
    }
 else {
      System.err.println(line);
    }
  }
  try {
    input.close();
  }
 catch (  IOException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 173090
Project: 173090
Buggy source:
public boolean passMessageDownstream(Object object,MPIMessage currentMessage){
  int src=router.mainTaskOfExecutor(instancePlan.getThisExecutor(),MPIContext.DEFAULT_PATH);
  RoutingParameters routingParameters=sendRoutingParameters(src,MPIContext.DEFAULT_PATH);
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(src);
  MPIMessage mpiMessage=new MPIMessage(src,type,MPIMessageDirection.OUT,delegete);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(src,mpiMessage,edge,di,MPIContext.DEFAULT_PATH,currentMessage.getHeader().getFlags(),routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  return pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(object,sendMessage));
}

Fixed version (ground truth):
public boolean passMessageDownstream(Object object,MPIMessage currentMessage){
  int src=router.mainTaskOfExecutor(instancePlan.getThisExecutor(),MPIContext.DEFAULT_PATH);
  RoutingParameters routingParameters=sendRoutingParameters(src,MPIContext.DEFAULT_PATH);
  ArrayBlockingQueue<Pair<Object,MPISendMessage>> pendingSendMessages=pendingSendMessagesPerSource.get(src);
  MPIMessage mpiMessage=new MPIMessage(src,type,MPIMessageDirection.OUT,delegete);
  int di=-1;
  if (routingParameters.getExternalRoutes().size() > 0) {
    di=routingParameters.getDestinationId();
  }
  MPISendMessage sendMessage=new MPISendMessage(src,mpiMessage,currentMessage.getHeader().getEdge(),di,MPIContext.DEFAULT_PATH,currentMessage.getHeader().getFlags(),routingParameters.getInternalRoutes(),routingParameters.getExternalRoutes());
  return pendingSendMessages.offer(new ImmutablePair<Object,MPISendMessage>(object,sendMessage));
}
Program: 173091
Project: 173091
Buggy source:
public void setStoreBased(boolean storeBased){
  isStoreBased=storeBased;
  if (isStoreBased) {
    opertionID=(int)System.currentTimeMillis();
    Path dataPath=new Path("String_Node_Str");
    this.memoryManager=new LMDBMemoryManager(dataPath);
    if (!isKeyed) {
      this.operationMemoryManager=memoryManager.addOperation(opertionID,MessageTypeConverter.toDataMessageType(type));
    }
 else {
      this.operationMemoryManager=memoryManager.addOperation(opertionID,MessageTypeConverter.toDataMessageType(type),MessageTypeConverter.toDataMessageType(keyType));
    }
  }
}

Fixed version (ground truth):
public void setStoreBased(boolean storeBased){
  isStoreBased=storeBased;
  if (isStoreBased) {
    opertionID=(int)System.currentTimeMillis();
    this.kryoSerializer=new KryoSerializer();
    Path dataPath=new Path("String_Node_Str");
    this.memoryManager=new LMDBMemoryManager(dataPath);
    if (!isKeyed) {
      this.operationMemoryManager=memoryManager.addOperation(opertionID,MessageTypeConverter.toDataMessageType(type));
    }
 else {
      this.operationMemoryManager=memoryManager.addOperation(opertionID,MessageTypeConverter.toDataMessageType(type),MessageTypeConverter.toDataMessageType(keyType));
    }
  }
}
Program: 173092
Project: 173092
Buggy source:
@Override public boolean onMessage(int source,int path,int target,int flags,Object object){
  boolean canAdd=true;
  List<Object> m=messages.get(target).get(source);
  Map<Integer,Boolean> finishedMessages=finished.get(target);
  if (m.size() > sendPendingMax) {
    canAdd=false;
    LOG.info(String.format("String_Node_Str",executor,target,source,counts.get(target)));
  }
 else {
    LOG.info(String.format("String_Node_Str",executor,target,source));
    if (object instanceof MPIMessage) {
      ((MPIMessage)object).incrementRefCount();
    }
    Integer c=counts.get(target).get(source);
    counts.get(target).put(source,c + 1);
    m.add(object);
    if ((flags & MessageFlags.FLAGS_LAST) == MessageFlags.FLAGS_LAST) {
      LOG.info(String.format("String_Node_Str",executor,target,source));
      finishedMessages.put(source,true);
    }
  }
  return canAdd;
}

Fixed version (ground truth):
@Override public boolean onMessage(int source,int path,int target,int flags,Object object){
  boolean canAdd=true;
  List<Object> m=messages.get(target).get(source);
  Map<Integer,Boolean> finishedMessages=finished.get(target);
  if (m.size() > sendPendingMax) {
    canAdd=false;
    LOG.info(String.format("String_Node_Str",executor,target,source,counts.get(target),finalMessages.size()));
  }
 else {
    LOG.info(String.format("String_Node_Str",executor,target,source,finishedMessages.size()));
    if (object instanceof MPIMessage) {
      ((MPIMessage)object).incrementRefCount();
    }
    Integer c=counts.get(target).get(source);
    counts.get(target).put(source,c + 1);
    m.add(object);
    if ((flags & MessageFlags.FLAGS_LAST) == MessageFlags.FLAGS_LAST) {
      LOG.info(String.format("String_Node_Str",executor,target,source));
      finishedMessages.put(source,true);
    }
  }
  return canAdd;
}
Program: 173094
Project: 173094
Buggy source:
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  executor=op.getTaskPlan().getThisExecutor();
  sendPendingMax=MPIContext.sendPendingMax(cfg);
  LOG.fine(String.format("String_Node_Str",executor,expectedIds));
  for (  Map.Entry<Integer,List<Integer>> e : expectedIds.entrySet()) {
    Map<Integer,List<Object>> messagesPerTask=new HashMap<>();
    Map<Integer,Boolean> finishedPerTask=new HashMap<>();
    Map<Integer,Integer> countsPerTask=new HashMap<>();
    for (    int i : e.getValue()) {
      messagesPerTask.put(i,new ArrayList<Object>());
      finishedPerTask.put(i,false);
      countsPerTask.put(i,0);
    }
    messages.put(e.getKey(),messagesPerTask);
    finished.put(e.getKey(),finishedPerTask);
    counts.put(e.getKey(),countsPerTask);
    batchDone.put(e.getKey(),false);
  }
  this.dataFlowOperation=op;
  this.executor=dataFlowOperation.getTaskPlan().getThisExecutor();
}

Fixed version (ground truth):
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  executor=op.getTaskPlan().getThisExecutor();
  sendPendingMax=MPIContext.sendPendingMax(cfg);
  this.dataFlowOperation=op;
  this.executor=dataFlowOperation.getTaskPlan().getThisExecutor();
  LOG.fine(String.format("String_Node_Str",executor,expectedIds));
  for (  Map.Entry<Integer,List<Integer>> e : expectedIds.entrySet()) {
    Map<Integer,List<Object>> messagesPerTask=new HashMap<>();
    Map<Integer,Boolean> finishedPerTask=new HashMap<>();
    Map<Integer,Integer> countsPerTask=new HashMap<>();
    for (    int task : e.getValue()) {
      messagesPerTask.put(task,new ArrayList<Object>());
      finishedPerTask.put(task,false);
      countsPerTask.put(task,0);
    }
    messages.put(e.getKey(),messagesPerTask);
    finished.put(e.getKey(),finishedPerTask);
    counts.put(e.getKey(),countsPerTask);
    batchDone.put(e.getKey(),false);
  }
}
Program: 173096
Project: 173096
Buggy source:
@Override public boolean receive(int target,Object object){
  count++;
  if (count % 1 == 0) {
    LOG.info(String.format("String_Node_Str",target,count));
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean receive(int target,Object object){
  count++;
  LOG.info(String.format("String_Node_Str",target,count));
  return true;
}
Program: 173097
Project: 173097
Buggy source:
public static int receiveBufferCount(Config cfg){
  return cfg.getIntegerValue(RECEIVE_BUFFERS_COUNT,32);
}

Fixed version (ground truth):
public static int receiveBufferCount(Config cfg){
  return cfg.getIntegerValue(RECEIVE_BUFFERS_COUNT,16);
}
Program: 173098
Project: 173098
Buggy source:
private boolean sendMessageToTarget(MPIMessage msgObj1,int i){
  msgObj1.incrementRefCount(1);
  int e=instancePlan.getExecutorForChannel(i);
  return channel.sendMessage(e,msgObj1,this);
}

Fixed version (ground truth):
private boolean sendMessageToTarget(MPIMessage msgObj1,int i){
  msgObj1.incrementRefCount();
  int e=instancePlan.getExecutorForChannel(i);
  return channel.sendMessage(e,msgObj1,this);
}
Program: 173099
Project: 173099
Buggy source:
protected void releaseTheBuffers(int id,MPIMessage message){
  lock.lock();
  try {
    if (MPIMessageDirection.IN == message.getMessageDirection()) {
      Queue<MPIBuffer> list=receiveBuffers.get(id);
      for (      MPIBuffer buffer : message.getBuffers()) {
        buffer.getByteBuffer().clear();
        list.offer(buffer);
      }
    }
 else     if (MPIMessageDirection.OUT == message.getMessageDirection()) {
      Queue<MPIBuffer> queue=sendBuffers;
      for (      MPIBuffer buffer : message.getBuffers()) {
        buffer.getByteBuffer().clear();
        queue.offer(buffer);
      }
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
protected void releaseTheBuffers(int id,MPIMessage message){
  lock.lock();
  try {
    if (MPIMessageDirection.IN == message.getMessageDirection()) {
      Queue<MPIBuffer> list=receiveBuffers.get(id);
      for (      MPIBuffer buffer : message.getBuffers()) {
        buffer.getByteBuffer().clear();
        list.offer(buffer);
        releasedReceivedBuffers++;
      }
    }
 else     if (MPIMessageDirection.OUT == message.getMessageDirection()) {
      Queue<MPIBuffer> queue=sendBuffers;
      for (      MPIBuffer buffer : message.getBuffers()) {
        buffer.getByteBuffer().clear();
        queue.offer(buffer);
        releasedSendBuffers++;
      }
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 173101
Project: 173101
Buggy source:
private boolean sendMessageToTarget(MPIMessage msgObj1,int i){
  msgObj1.incrementRefCount(1);
  int e=instancePlan.getExecutorForChannel(i);
  return channel.sendMessage(e,msgObj1,this);
}

Fixed version (ground truth):
private boolean sendMessageToTarget(MPIMessage msgObj1,int i){
  msgObj1.incrementRefCount(0);
  int e=instancePlan.getExecutorForChannel(i);
  return channel.sendMessage(e,msgObj1,this);
}