nus-yam/ex-repair huggingface dataset:
Program: 172857
Project: 172857
Buggy source:
private boolean serializeKeyedData(Object content,Object key,SerializeState state,DataBuffer targetBuffer,MessageType contentType,MessageType keyType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int keyLength=KeySerializer.serializeKey(key,keyType,state,serializer);
    int dataLength=DataSerializer.serializeData(content,contentType,state,serializer);
  }
  if (state.getPart() == SerializeState.Part.INIT || state.getPart() == SerializeState.Part.HEADER) {
    boolean complete=KeySerializer.copyKeyToBuffer(key,keyType,targetBuffer.getByteBuffer(),state,serializer);
    if (complete) {
      state.setPart(SerializeState.Part.BODY);
    }
 else {
      state.setPart(SerializeState.Part.HEADER);
    }
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,contentType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean serializeKeyedData(Object content,Object key,SerializeState state,DataBuffer targetBuffer,MessageType contentType,MessageType keyType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int keyLength=KeySerializer.serializeKey(key,keyType,state,serializer);
    int dataLength=DataSerializer.serializeData(content,contentType,state,serializer);
    state.setCurretHeaderLength(dataLength + keyLength);
  }
  if (state.getPart() == SerializeState.Part.INIT || state.getPart() == SerializeState.Part.HEADER) {
    boolean complete=KeySerializer.copyKeyToBuffer(key,keyType,targetBuffer.getByteBuffer(),state,serializer);
    if (complete) {
      state.setPart(SerializeState.Part.BODY);
    }
 else {
      state.setPart(SerializeState.Part.HEADER);
    }
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,contentType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}
Program: 172859
Project: 172859
Buggy source:
private static TWSChannel initializeTCPNetwork(Config config,IWorkerController wController,ResourcePlan resourcePlan){
  TCPChannel channel;
  int index=wController.getWorkerNetworkInfo().getWorkerID();
  Integer workerPort=wController.getWorkerNetworkInfo().getWorkerPort();
  String localIp=wController.getWorkerNetworkInfo().getWorkerIP().getHostAddress();
  try {
    channel=createChannel(config,new WorkerNetworkInfo(InetAddress.getByName(localIp),workerPort,index),index);
    channel.startListening();
  }
 catch (  UnknownHostException e) {
    throw new RuntimeException("String_Node_Str" + localIp,e);
  }
  wController.waitOnBarrier(30);
  List<WorkerNetworkInfo> wInfo=wController.getWorkerList();
  List<NetworkInfo> nInfos=new ArrayList<>();
  for (  WorkerNetworkInfo w : wInfo) {
    NetworkInfo networkInfo=new NetworkInfo(w.getWorkerID());
    networkInfo.addProperty(TCPContext.NETWORK_PORT,w.getWorkerPort());
    networkInfo.addProperty(TCPContext.NETWORK_HOSTNAME,w.getWorkerIP().getHostAddress());
    nInfos.add(networkInfo);
    ResourceContainer container=new ResourceContainer(w.getWorkerID());
    resourcePlan.addContainer(container);
  }
  channel.startConnections(nInfos);
  channel.waitForConnections();
  return new TWSTCPChannel(config,resourcePlan.getThisId(),channel);
}

Fixed version (ground truth):
private static TWSChannel initializeTCPNetwork(Config config,IWorkerController wController,ResourcePlan resourcePlan){
  TCPChannel channel;
  int index=wController.getWorkerNetworkInfo().getWorkerID();
  Integer workerPort=wController.getWorkerNetworkInfo().getWorkerPort();
  String localIp=wController.getWorkerNetworkInfo().getWorkerIP().getHostAddress();
  try {
    channel=createChannel(config,new WorkerNetworkInfo(InetAddress.getByName(localIp),workerPort,index),index);
    channel.startListening();
  }
 catch (  UnknownHostException e) {
    throw new RuntimeException("String_Node_Str" + localIp,e);
  }
  wController.waitOnBarrier(30000);
  List<WorkerNetworkInfo> wInfo=wController.getWorkerList();
  List<NetworkInfo> nInfos=new ArrayList<>();
  for (  WorkerNetworkInfo w : wInfo) {
    NetworkInfo networkInfo=new NetworkInfo(w.getWorkerID());
    networkInfo.addProperty(TCPContext.NETWORK_PORT,w.getWorkerPort());
    networkInfo.addProperty(TCPContext.NETWORK_HOSTNAME,w.getWorkerIP().getHostAddress());
    nInfos.add(networkInfo);
    ResourceContainer container=new ResourceContainer(w.getWorkerID());
    resourcePlan.addContainer(container);
  }
  channel.startConnections(nInfos);
  channel.waitForConnections();
  return new TWSTCPChannel(config,resourcePlan.getThisId(),channel);
}
Program: 172860
Project: 172860
Buggy source:
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  worker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}

Fixed version (ground truth):
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  worker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  executor=op.getTaskPlan().getThisExecutor();
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}
Program: 172861
Project: 172861
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    if (finished.contains(source)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",worker,source));
    }
 else {
      finished.add(source);
    }
    if (finished.size() == partition.getSources().size()) {
      finishedTargets.add(target);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    if (finished.contains(source)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",worker,source));
    }
 else {
      finished.add(source);
    }
    if (finished.size() == partition.getSources().size()) {
      finishedTargets.add(target);
    }
 else {
      LOG.log(Level.INFO,executor + "String_Node_Str" + finished);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}
Program: 172862
Project: 172862
Buggy source:
public void partition(int source,Object message,int flags){
  int destinations=destinationSelector.next(source);
  partition.send(source,message,flags,destinations);
}

Fixed version (ground truth):
public boolean partition(int source,Object message,int flags){
  int destinations=destinationSelector.next(source);
  return partition.send(source,message,flags,destinations);
}
Program: 172863
Project: 172863
Buggy source:
@SuppressWarnings("String_Node_Str") private void serializeBody(Object object,OutMessage sendMessage,DataBuffer buffer){
  List objectList=(List)object;
  SerializeState state=sendMessage.getSerializationState();
  boolean isTailPart=false;
  if (sendMessage.serializedState() == OutMessage.SendState.PARTIALLY_SERIALIZED && state.getData() != null) {
    isTailPart=true;
  }
  int startIndex=state.getCurrentObject();
  int remaining=buffer.getByteBuffer().remaining();
  if (remaining <= MAX_SUB_MESSAGE_HEADER_SPACE) {
    throw new RuntimeException("String_Node_Str" + remaining);
  }
  for (int i=startIndex; i < objectList.size(); i++) {
    Object o=objectList.get(i);
    if (o instanceof ChannelMessage) {
      ChannelMessage channelMessage=(ChannelMessage)o;
      boolean complete=serializeBufferedMessage(channelMessage,state,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
      }
 else {
        break;
      }
    }
 else {
      boolean complete=serializeMessage(o,sendMessage,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
        if (isTailPart) {
          break;
        }
      }
 else {
        break;
      }
    }
    remaining=buffer.getByteBuffer().remaining();
    if (!(remaining > MAX_SUB_MESSAGE_HEADER_SPACE && state.getCurrentObject() < objectList.size())) {
      break;
    }
  }
  if (state.getCurrentObject() == objectList.size()) {
    sendMessage.setSendState(OutMessage.SendState.SERIALIZED);
  }
 else {
    sendMessage.setSendState(OutMessage.SendState.PARTIALLY_SERIALIZED);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void serializeBody(Object object,OutMessage sendMessage,DataBuffer buffer){
  List objectList=(List)object;
  SerializeState state=sendMessage.getSerializationState();
  int startIndex=state.getCurrentObject();
  int remaining=buffer.getByteBuffer().remaining();
  if (remaining <= MAX_SUB_MESSAGE_HEADER_SPACE) {
    throw new RuntimeException("String_Node_Str" + remaining);
  }
  for (int i=startIndex; i < objectList.size(); i++) {
    Object o=objectList.get(i);
    if (o instanceof ChannelMessage) {
      ChannelMessage channelMessage=(ChannelMessage)o;
      boolean complete=serializeBufferedMessage(channelMessage,state,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
      }
 else {
        break;
      }
    }
 else {
      boolean complete=serializeMessage(o,sendMessage,buffer);
      if (complete) {
        state.setCurrentObject(i + 1);
      }
 else {
        break;
      }
    }
    remaining=buffer.getByteBuffer().remaining();
    if (!(remaining > MAX_SUB_MESSAGE_HEADER_SPACE && state.getCurrentObject() < objectList.size())) {
      break;
    }
  }
  if (state.getCurrentObject() == objectList.size()) {
    sendMessage.setSendState(OutMessage.SendState.SERIALIZED);
  }
 else {
    sendMessage.setSendState(OutMessage.SendState.PARTIALLY_SERIALIZED);
  }
}
Program: 172865
Project: 172865
Buggy source:
/** 
 * Serializes a java object using kryo serialization
 */
private boolean serializeData(Object content,SerializeState state,DataBuffer targetBuffer,MessageType messageType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int dataLength=DataSerializer.serializeData(content,messageType,state,serializer);
    if (!buildSubMessageHeader(targetBuffer,dataLength)) {
      LOG.warning("String_Node_Str");
      return false;
    }
    state.addTotalBytes(NORMAL_SUB_MESSAGE_HEADER_SIZE);
    state.setPart(SerializeState.Part.BODY);
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,messageType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Serializes a java object using kryo serialization
 */
private boolean serializeData(Object content,SerializeState state,DataBuffer targetBuffer,MessageType messageType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int dataLength=DataSerializer.serializeData(content,messageType,state,serializer);
    int remaining=targetBuffer.getByteBuffer().remaining();
    if (remaining < dataLength + MAX_SUB_MESSAGE_HEADER_SPACE) {
      LOG.fine("String_Node_Str" + "String_Node_Str");
      return false;
    }
    if (!buildSubMessageHeader(targetBuffer,dataLength)) {
      LOG.warning("String_Node_Str");
      return false;
    }
    state.addTotalBytes(NORMAL_SUB_MESSAGE_HEADER_SIZE);
    state.setPart(SerializeState.Part.BODY);
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,messageType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}
Program: 172866
Project: 172866
Buggy source:
private boolean serializeKeyedData(Object content,Object key,SerializeState state,DataBuffer targetBuffer,MessageType contentType,MessageType keyType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int keyLength=KeySerializer.serializeKey(key,keyType,state,serializer);
    int dataLength=DataSerializer.serializeData(content,contentType,state,serializer);
    if (!buildSubMessageHeader(targetBuffer,dataLength + keyLength)) {
      LOG.warning("String_Node_Str");
      return false;
    }
    state.setTotalBytes(state.getTotalBytes() + NORMAL_SUB_MESSAGE_HEADER_SIZE);
  }
  if (state.getPart() == SerializeState.Part.INIT || state.getPart() == SerializeState.Part.HEADER) {
    boolean complete=KeySerializer.copyKeyToBuffer(key,keyType,targetBuffer.getByteBuffer(),state,serializer);
    if (complete) {
      state.setPart(SerializeState.Part.BODY);
    }
 else {
      state.setPart(SerializeState.Part.HEADER);
    }
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,contentType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean serializeKeyedData(Object content,Object key,SerializeState state,DataBuffer targetBuffer,MessageType contentType,MessageType keyType){
  ByteBuffer byteBuffer=targetBuffer.getByteBuffer();
  if (state.getPart() == SerializeState.Part.INIT) {
    int keyLength=KeySerializer.serializeKey(key,keyType,state,serializer);
    int dataLength=DataSerializer.serializeData(content,contentType,state,serializer);
    int remaining=targetBuffer.getByteBuffer().remaining();
    if (remaining < dataLength + keyLength + MAX_SUB_MESSAGE_HEADER_SPACE) {
      LOG.fine("String_Node_Str" + "String_Node_Str");
      return false;
    }
    if (!buildSubMessageHeader(targetBuffer,dataLength + keyLength)) {
      LOG.warning("String_Node_Str");
      return false;
    }
    state.setTotalBytes(state.getTotalBytes() + NORMAL_SUB_MESSAGE_HEADER_SIZE);
  }
  if (state.getPart() == SerializeState.Part.INIT || state.getPart() == SerializeState.Part.HEADER) {
    boolean complete=KeySerializer.copyKeyToBuffer(key,keyType,targetBuffer.getByteBuffer(),state,serializer);
    if (complete) {
      state.setPart(SerializeState.Part.BODY);
    }
 else {
      state.setPart(SerializeState.Part.HEADER);
    }
  }
  if (state.getPart() != SerializeState.Part.BODY) {
    return false;
  }
  boolean completed=DataSerializer.copyDataToBuffer(content,contentType,byteBuffer,state,serializer);
  targetBuffer.setSize(byteBuffer.position());
  if (completed) {
    state.setBytesCopied(0);
    state.setBufferNo(0);
    state.setData(null);
    state.setPart(SerializeState.Part.INIT);
    state.setKeySize(0);
    return true;
  }
 else {
    return false;
  }
}
Program: 172872
Project: 172872
Buggy source:
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  worker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  executor=op.getTaskPlan().getThisExecutor();
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}

Fixed version (ground truth):
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  thisWorker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  taskPlan=op.getTaskPlan();
  participatingWorkers=TaskPlanUtils.getWorkersOfTasks(taskPlan,((DataFlowPartition)op).getSources());
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}
Program: 172873
Project: 172873
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    if (finished.contains(source)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",worker,source));
    }
 else {
      finished.add(source);
    }
    if (finished.size() == partition.getSources().size()) {
      finishedTargets.add(target);
    }
 else {
      LOG.log(Level.INFO,executor + "String_Node_Str" + finished);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    int worker=taskPlan.getExecutorForChannel(source);
    if (finished.contains(worker)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",this.thisWorker,worker));
    }
 else {
      finished.add(worker);
    }
    if (finished.size() == participatingWorkers.size()) {
      finishedTargets.add(target);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}
Program: 172875
Project: 172875
Buggy source:
/** 
 * Called when the end of the operation is reached
 */
default void onFinish(int target){
}

Fixed version (ground truth):
/** 
 * Called when the end of the operation is reached
 */
default void onFinish(int source){
}
Program: 172876
Project: 172876
Buggy source:
@Override public void finish(int source){
  if (partialReceiver != null) {
    partialReceiver.onFinish(source * -1);
  }
}

Fixed version (ground truth):
@Override public void finish(int source){
  if (partialReceiver != null) {
    partialReceiver.onFinish(source);
  }
}
Program: 172877
Project: 172877
Buggy source:
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  thisWorker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  taskPlan=op.getTaskPlan();
  participatingWorkers=TaskPlanUtils.getWorkersOfTasks(taskPlan,((DataFlowPartition)op).getSources());
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}

Fixed version (ground truth):
public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  int maxBytesInMemory=DataFlowContext.getShuffleMaxBytesInMemory(cfg);
  int maxRecordsInMemory=DataFlowContext.getShuffleMaxRecordsInMemory(cfg);
  String path=DataFlowContext.getShuffleDirectoryPath(cfg);
  thisWorker=op.getTaskPlan().getThisExecutor();
  finishedSources=new HashMap<>();
  partition=(DataFlowPartition)op;
  keyed=partition.getKeyType() != null;
  targets=new HashSet<>(expectedIds.keySet());
  for (  Integer target : expectedIds.keySet()) {
    Map<Integer,Boolean> perTarget=new ConcurrentHashMap<>();
    for (    Integer exp : expectedIds.get(target)) {
      perTarget.put(exp,false);
    }
    Shuffle sortedMerger;
    if (partition.getKeyType() == null) {
      sortedMerger=new FSMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getDataType());
    }
 else {
      if (sorted) {
        sortedMerger=new FSKeyedSortedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType(),comparator,target);
      }
 else {
        sortedMerger=new FSKeyedMerger(maxBytesInMemory,maxRecordsInMemory,path,getOperationName(target),partition.getKeyType(),partition.getDataType());
      }
    }
    sortedMergers.put(target,sortedMerger);
    totalReceives.put(target,0);
    finishedSources.put(target,new HashSet<>());
  }
}
Program: 172878
Project: 172878
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    int worker=taskPlan.getExecutorForChannel(source);
    if (finished.contains(worker)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",this.thisWorker,worker));
    }
 else {
      finished.add(worker);
    }
    if (finished.size() == participatingWorkers.size()) {
      finishedTargets.add(target);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public boolean onMessage(int source,int destination,int target,int flags,Object object){
  Shuffle sortedMerger=sortedMergers.get(target);
  if (sortedMerger == null) {
    throw new RuntimeException("String_Node_Str" + target);
  }
  if ((flags & MessageFlags.EMPTY) == MessageFlags.EMPTY) {
    Set<Integer> finished=finishedSources.get(target);
    if (finished.contains(source)) {
      LOG.log(Level.WARNING,String.format("String_Node_Str",this.thisWorker,source));
    }
 else {
      finished.add(source);
    }
    if (finished.size() == partition.getSources().size()) {
      finishedTargets.add(target);
    }
    return true;
  }
  if (keyed) {
    List<KeyedContent> keyedContents=(List<KeyedContent>)object;
    for (    KeyedContent kc : keyedContents) {
      Object data=kc.getValue();
      byte[] d=kryoSerializer.serialize(data);
      sortedMerger.add(kc.getKey(),d,d.length);
    }
    int total=totalReceives.get(target);
    total+=keyedContents.size();
    totalReceives.put(target,total);
  }
 else {
    List<Object> contents=(List<Object>)object;
    for (    Object kc : contents) {
      byte[] d=kryoSerializer.serialize(kc);
      sortedMerger.add(d,d.length);
    }
    int total=totalReceives.get(target);
    total+=contents.size();
    totalReceives.put(target,total);
  }
  return true;
}
Program: 172879
Project: 172879
Buggy source:
@Override public boolean progress(){
  for (  Shuffle sorts : sortedMergers.values()) {
    sorts.run();
  }
  for (  int i : finishedTargets) {
    if (!finishedTargetsCompleted.contains(i)) {
      onFinish(i);
      finishedTargetsCompleted.add(i);
    }
  }
  return !finishedTargets.equals(targets);
}

Fixed version (ground truth):
@Override public boolean progress(){
  for (  Shuffle sorts : sortedMergers.values()) {
    sorts.run();
  }
  for (  int i : finishedTargets) {
    if (!finishedTargetsCompleted.contains(i)) {
      finishTarget(i);
      finishedTargetsCompleted.add(i);
    }
  }
  return !finishedTargets.equals(targets);
}
Program: 172880
Project: 172880
Buggy source:
@Override public void onFinish(int target){
  Shuffle sortedMerger=sortedMergers.get(target);
  sortedMerger.switchToReading();
  Iterator<Object> itr=sortedMerger.readIterator();
  batchReceiver.receive(target,itr);
}

Fixed version (ground truth):
@Override public void onFinish(int source){
}
Program: 172881
Project: 172881
Buggy source:
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  lowWaterMark=DataFlowContext.getNetworkPartitionMessageGroupLowWaterMark(cfg);
  highWaterMark=DataFlowContext.getNetworkPartitionMessageGroupHighWaterMark(cfg);
  executor=op.getTaskPlan().getThisExecutor();
  destinations=((DataFlowPartition)op).getDestinations();
  this.operation=op;
  for (  int d : destinations) {
    destinationMessages.put(d,new ArrayList<>());
  }
}

Fixed version (ground truth):
@Override public void init(Config cfg,DataFlowOperation op,Map<Integer,List<Integer>> expectedIds){
  lowWaterMark=DataFlowContext.getNetworkPartitionMessageGroupLowWaterMark(cfg);
  highWaterMark=DataFlowContext.getNetworkPartitionMessageGroupHighWaterMark(cfg);
  executor=op.getTaskPlan().getThisExecutor();
  TaskPlan taskPlan=op.getTaskPlan();
  thisWorkerSources=TaskPlanUtils.getTasksOfThisWorker(taskPlan,((DataFlowPartition)op).getSources());
  for (  int s : thisWorkerSources) {
    finishedDestinations.put(s,new HashSet<>());
  }
  destinations=((DataFlowPartition)op).getDestinations();
  this.operation=op;
  for (  int d : destinations) {
    destinationMessages.put(d,new ArrayList<>());
  }
}
Program: 172882
Project: 172882
Buggy source:
@Override public boolean onMessage(int src,int destination,int target,int flags,Object object){
  this.source=src;
  List<Object> dests=destinationMessages.get(destination);
  int size=dests.size();
  if (size > highWaterMark) {
    return false;
  }
  lock.lock();
  try {
    dests.add(object);
    if (dests.size() > lowWaterMark) {
      swapToReady(destination,dests);
    }
  }
  finally {
    lock.unlock();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean onMessage(int src,int destination,int target,int flags,Object object){
  this.representSource=src;
  List<Object> dests=destinationMessages.get(destination);
  int size=dests.size();
  if (size > highWaterMark) {
    return false;
  }
  lock.lock();
  try {
    dests.add(object);
    if (dests.size() > lowWaterMark) {
      swapToReady(destination,dests);
    }
  }
  finally {
    lock.unlock();
  }
  return true;
}
Program: 172884
Project: 172884
Buggy source:
@Override public void onFinish(int target){
  lock.lock();
  try {
    for (    Map.Entry<Integer,List<Object>> e : destinationMessages.entrySet()) {
      List<Object> messages=new ArrayList<>();
      Integer key=e.getKey();
      if (readyToSend.containsKey(key)) {
        messages=readyToSend.get(key);
      }
 else {
        readyToSend.put(key,messages);
      }
      messages.addAll(e.getValue());
    }
    finish=true;
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
@Override public void onFinish(int source){
  lock.lock();
  try {
    for (    Map.Entry<Integer,List<Object>> e : destinationMessages.entrySet()) {
      List<Object> messages=new ArrayList<>();
      Integer key=e.getKey();
      if (readyToSend.containsKey(key)) {
        messages=readyToSend.get(key);
      }
 else {
        readyToSend.put(key,messages);
      }
      messages.addAll(e.getValue());
    }
    onFinishedSources.add(source);
  }
  finally {
    lock.unlock();
  }
}
Program: 172885
Project: 172885
Buggy source:
@Override public void onFinish(int target){
}

Fixed version (ground truth):
@Override public void onFinish(int source){
}
Program: 172886
Project: 172886
Buggy source:
@Override public void init(Config config,int id,ResourcePlan resourcePlan,IWorkerController workerController,IPersistentVolume persistentVolume,IVolatileVolume volatileVolume){
  this.workerController=workerController;
  workerNetworkInfo=workerController.getWorkerNetworkInfo();
  LOG.info("String_Node_Str" + workerNetworkInfo);
  Thread echoServer=new Thread(this);
  echoServer.start();
  List<WorkerNetworkInfo> workerList=workerController.waitForAllWorkersToJoin(50000);
  if (workerList != null) {
    LOG.info("String_Node_Str" + WorkerNetworkInfo.workerListAsString(workerList));
  }
 else {
    LOG.severe("String_Node_Str");
    return;
  }
  try {
    Thread.sleep(2000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  for (  WorkerNetworkInfo worker : workerList) {
    if (worker.equals(workerNetworkInfo)) {
      continue;
    }
    sendReceiveHello(worker);
  }
  K8sWorkerUtils.waitIndefinitely();
}

Fixed version (ground truth):
@Override public void init(Config config,int id,ResourcePlan resourcePlan,IWorkerController wController,IPersistentVolume persistentVolume,IVolatileVolume volatileVolume){
  this.workerController=wController;
  workerNetworkInfo=wController.getWorkerNetworkInfo();
  LOG.info("String_Node_Str" + workerNetworkInfo);
  Thread echoServer=new Thread(this);
  echoServer.start();
  List<WorkerNetworkInfo> workerList=wController.waitForAllWorkersToJoin(50000);
  if (workerList != null) {
    LOG.info("String_Node_Str" + WorkerNetworkInfo.workerListAsString(workerList));
  }
 else {
    LOG.severe("String_Node_Str");
    return;
  }
  try {
    Thread.sleep(2000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  for (  WorkerNetworkInfo worker : workerList) {
    if (worker.equals(workerNetworkInfo)) {
      continue;
    }
    sendReceiveHello(worker);
  }
  K8sWorkerUtils.waitIndefinitely();
}
Program: 172887
Project: 172887
Buggy source:
@Override public void init(Config cfg,int wID,ResourcePlan plan,IWorkerDiscoverer workerController,IPersistentVolume persistentVolume,IVolatileVolume volatileVolume){
  this.config=cfg;
  this.resourcePlan=plan;
  this.id=wID;
  setupNetwork(cfg,workerController,plan);
  List<WorkerNetworkInfo> workerList=workerController.waitForAllWorkersToJoin(50000);
  if (workerList != null) {
    LOG.info("String_Node_Str" + WorkerNetworkInfo.workerListAsString(workerList));
  }
 else {
    LOG.severe("String_Node_Str");
    return;
  }
  setupTasks();
  this.noOfTasksPerExecutor=NO_OF_TASKS / plan.noOfContainers();
  partition=new DataFlowPartition(config,channel,taskPlan,sources,destinations,new PartitionBatchFinalReceiver(new RecordSave(),false,true,new IntegerComparator()),new PartitionPartialReceiver(),DataFlowPartition.PartitionStratergy.DIRECT,MessageType.BYTE,MessageType.BYTE,MessageType.INTEGER,MessageType.INTEGER,OperationSemantics.STREAMING_BATCH,new EdgeGenerator(0));
  scheduleTasks();
  progress();
}

Fixed version (ground truth):
@Override public void init(Config cfg,int wID,ResourcePlan plan,IWorkerDiscoverer workerController,IPersistentVolume persistentVolume,IVolatileVolume volatileVolume){
  this.config=cfg;
  this.resourcePlan=plan;
  this.id=wID;
  setupNetwork(cfg,workerController,plan);
  setupTasks();
  this.noOfTasksPerExecutor=NO_OF_TASKS / plan.noOfContainers();
  partition=new DataFlowPartition(config,channel,taskPlan,sources,destinations,new PartitionBatchFinalReceiver(new RecordSave(),false,true,new IntegerComparator()),new PartitionPartialReceiver(),DataFlowPartition.PartitionStratergy.DIRECT,MessageType.BYTE,MessageType.BYTE,MessageType.INTEGER,MessageType.INTEGER,OperationSemantics.STREAMING_BATCH,new EdgeGenerator(0));
  scheduleTasks();
  progress();
}
Program: 172888
Project: 172888
Buggy source:
public Double getDoubleValue(String key,double defaultValue){
  Object value=get(key);
  if (value != null) {
    if (value instanceof Integer || value instanceof Double) {
      return (Double)value;
    }
 else     if (value instanceof String) {
      return Double.valueOf((String)value);
    }
 else {
      return defaultValue;
    }
  }
  return defaultValue;
}

Fixed version (ground truth):
public Double getDoubleValue(String key,double defaultValue){
  Object value=get(key);
  if (value != null) {
    if (value instanceof Integer) {
      return ((Integer)value).doubleValue();
    }
 else     if (value instanceof Double) {
      return (Double)value;
    }
 else     if (value instanceof String) {
      return Double.valueOf((String)value);
    }
 else {
      return defaultValue;
    }
  }
  return defaultValue;
}
Program: 172889
Project: 172889
Buggy source:
private void listWorkersMessageReceived(RequestID id,Network.ListWorkersRequest listMessage){
  if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.IMMEDIATE_RESPONSE) {
    sendListWorkersResponse(listMessage.getWorkerID(),id);
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
 else   if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.RESPONSE_AFTER_ALL_JOINED) {
    waitList.put(listMessage.getWorkerID(),id);
    if (workers.size() == numberOfWorkers) {
      sendListWorkersResponseToWaitList();
    }
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
  LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
}

Fixed version (ground truth):
private void listWorkersMessageReceived(RequestID id,Network.ListWorkersRequest listMessage){
  if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.IMMEDIATE_RESPONSE) {
    sendListWorkersResponse(listMessage.getWorkerID(),id);
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
 else   if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.RESPONSE_AFTER_ALL_JOINED) {
    if (workers.size() == numberOfWorkers) {
      sendListWorkersResponse(listMessage.getWorkerID(),id);
    }
 else {
      waitList.put(listMessage.getWorkerID(),id);
    }
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
}
Program: 172891
Project: 172891
Buggy source:
/** 
 * We can receive messages from internal tasks or an external task, we allways receive messages to the main task of the executor and we go from there
 * @param currentMessage
 * @param object
 */
@Override public boolean receiveMessage(ChannelMessage currentMessage,Object object){
  MessageHeader header=currentMessage.getHeader();
  int messageDestId=currentMessage.getHeader().getDestinationIdentifier();
  if (!isLast() && partialReceiver != null) {
    return partialReceiver.onMessage(header.getSourceId(),DataFlowContext.DEFAULT_DESTINATION,router.mainTaskOfExecutor(instancePlan.getThisExecutor(),DataFlowContext.DEFAULT_DESTINATION),header.getFlags(),currentMessage);
  }
 else {
    return finalReceiver.onMessage(header.getSourceId(),DataFlowContext.DEFAULT_DESTINATION,router.mainTaskOfExecutor(instancePlan.getThisExecutor(),DataFlowContext.DEFAULT_DESTINATION),header.getFlags(),object);
  }
}

Fixed version (ground truth):
/** 
 * We can receive messages from internal tasks or an external task, we allways receive messages to the main task of the executor and we go from there
 */
@Override public boolean receiveMessage(ChannelMessage currentMessage,Object object){
  MessageHeader header=currentMessage.getHeader();
  int messageDestId=currentMessage.getHeader().getDestinationIdentifier();
  if (!isLast() && partialReceiver != null) {
    return partialReceiver.onMessage(header.getSourceId(),DataFlowContext.DEFAULT_DESTINATION,router.mainTaskOfExecutor(instancePlan.getThisExecutor(),DataFlowContext.DEFAULT_DESTINATION),header.getFlags(),currentMessage);
  }
 else {
    return finalReceiver.onMessage(header.getSourceId(),DataFlowContext.DEFAULT_DESTINATION,router.mainTaskOfExecutor(instancePlan.getThisExecutor(),DataFlowContext.DEFAULT_DESTINATION),header.getFlags(),object);
  }
}
Program: 172893
Project: 172893
Buggy source:
public int getGroupOfExecutor(int executor){
  return executorToGroup.get(executor);
}

Fixed version (ground truth):
public int getGroupOfExecutor(int executor){
  if (executorToGroup.containsKey(executor)) {
    return executorToGroup.get(executor);
  }
  return 0;
}
Program: 172894
Project: 172894
Buggy source:
public Set<Integer> getExecutesOfGroup(int group){
  return groupsToExecutor.get(group);
}

Fixed version (ground truth):
public Set<Integer> getExecutesOfGroup(int group){
  if (groupsToExecutor.keySet().size() == 0) {
    return new HashSet<>(executorToChannels.keySet());
  }
  return groupsToExecutor.get(group);
}
Program: 172895
Project: 172895
Buggy source:
private void listWorkersMessageReceived(RequestID id,Network.ListWorkersRequest listMessage){
  if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.IMMEDIATE_RESPONSE) {
    sendListWorkersResponse(listMessage.getWorkerID(),id);
  }
 else   if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.RESPONSE_AFTER_ALL_JOINED) {
    if (workers.size() == numberOfWorkers) {
      sendListWorkersResponse(listMessage.getWorkerID(),id);
    }
 else {
      waitList.put(listMessage.getWorkerID(),id);
    }
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
}

Fixed version (ground truth):
private void listWorkersMessageReceived(RequestID id,Network.ListWorkersRequest listMessage){
  if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.IMMEDIATE_RESPONSE) {
    sendListWorkersResponse(listMessage.getWorkerID(),id);
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
 else   if (listMessage.getRequestType() == Network.ListWorkersRequest.RequestType.RESPONSE_AFTER_ALL_JOINED) {
    if (workers.size() == numberOfWorkers) {
      sendListWorkersResponse(listMessage.getWorkerID(),id);
    }
 else {
      waitList.put(listMessage.getWorkerID(),id);
    }
    LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
  }
  LOG.log(Level.INFO,String.format("String_Node_Str",numberOfWorkers,workers.size()));
}
Program: 172896
Project: 172896
Buggy source:
public JobMasterClient(Config config,WorkerNetworkInfo thisWorker){
  this.config=config;
  this.thisWorker=thisWorker;
  this.masterAddress=JobMasterContext.jobMasterIP(config);
  this.masterPort=JobMasterContext.jobMasterPort(config);
}

Fixed version (ground truth):
public JobMasterClient(Config config,WorkerNetworkInfo thisWorker,String masterHost,int masterPort){
  this.config=config;
  this.thisWorker=thisWorker;
  this.masterAddress=masterHost;
  this.masterPort=masterPort;
}