Program: 172870
Project: 172870
Buggy source:
/** 
 * Initialize
 */
public void init(Config cfg,MessageType t,TaskPlan taskPlan,int ed){
  this.edge=ed;
  this.thisSources=TaskPlanUtils.getTasksOfThisExecutor(taskPlan,sources);
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor(),sources,destinations));
  this.thisTasks=taskPlan.getTasksOfThisExecutor();
  this.router=new PartitionRouter(taskPlan,sources,destinations);
  Map<Integer,Set<Integer>> internal=router.getInternalSendTasks(0);
  Map<Integer,Set<Integer>> external=router.getExternalSendTasks(0);
  this.instancePlan=taskPlan;
  this.dataType=t;
  if (this.receiveType == null) {
    this.receiveType=dataType;
  }
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor()));
  for (  int s : thisSources) {
    Set<Integer> integerSetMap=internal.get(s);
    if (integerSetMap != null) {
      this.dests.internal.addAll(integerSetMap);
    }
    Set<Integer> integerSetMap1=external.get(s);
    if (integerSetMap1 != null) {
      this.dests.external.addAll(integerSetMap1);
    }
    LOG.fine(String.format("String_Node_Str",taskPlan.getThisExecutor(),s));
    break;
  }
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor()));
  if (this.finalReceiver != null && isLastReceiver()) {
    this.finalReceiver.init(cfg,this,receiveExpectedTaskIds());
  }
  if (this.partialReceiver != null) {
    this.partialReceiver.init(cfg,this,receiveExpectedTaskIds());
  }
  Map<Integer,ArrayBlockingQueue<Pair<Object,OutMessage>>> pendingSendMessagesPerSource=new HashMap<>();
  Map<Integer,Queue<Pair<Object,ChannelMessage>>> pendingReceiveMessagesPerSource=new HashMap<>();
  Map<Integer,Queue<ChannelMessage>> pendingReceiveDeSerializations=new HashMap<>();
  Map<Integer,MessageSerializer> serializerMap=new HashMap<>();
  Map<Integer,MessageDeSerializer> deSerializerMap=new HashMap<>();
  Set<Integer> srcs=TaskPlanUtils.getTasksOfThisExecutor(taskPlan,sources);
  Set<Integer> tempsrcs=TaskPlanUtils.getTasksOfThisExecutor(taskPlan,sources);
  for (  Integer src : tempsrcs) {
    srcs.add((src * -1) - 1);
  }
  for (  int s : srcs) {
    ArrayBlockingQueue<Pair<Object,OutMessage>> pendingSendMessages=new ArrayBlockingQueue<Pair<Object,OutMessage>>(DataFlowContext.sendPendingMax(cfg));
    pendingSendMessagesPerSource.put(s,pendingSendMessages);
    serializerMap.put(s,new MultiMessageSerializer(new KryoSerializer(),executor));
  }
  int maxReceiveBuffers=DataFlowContext.receiveBufferCount(cfg);
  int receiveExecutorsSize=receivingExecutors().size();
  if (receiveExecutorsSize == 0) {
    receiveExecutorsSize=1;
  }
  Set<Integer> execs=router.receivingExecutors();
  for (  int ex : execs) {
    int capacity=maxReceiveBuffers * 2 * receiveExecutorsSize;
    Queue<Pair<Object,ChannelMessage>> pendingReceiveMessages=new ArrayBlockingQueue<Pair<Object,ChannelMessage>>(capacity);
    pendingReceiveMessagesPerSource.put(ex,pendingReceiveMessages);
    pendingReceiveDeSerializations.put(ex,new ArrayBlockingQueue<ChannelMessage>(capacity));
    deSerializerMap.put(ex,new MultiMessageDeserializer(new KryoSerializer(),executor));
  }
  for (  int src : srcs) {
    for (    int dest : destinations) {
      sendRoutingParameters(src,dest);
    }
  }
  delegete.setCompletionListener(completionListener);
  delegete.init(cfg,t,receiveType,keyType,receiveKeyType,taskPlan,edge,router.receivingExecutors(),router.isLastReceiver(),this,pendingSendMessagesPerSource,pendingReceiveMessagesPerSource,pendingReceiveDeSerializations,serializerMap,deSerializerMap,isKeyed);
  delegete.setKeyType(keyType);
}

Fixed version (ground truth):
/** 
 * Initialize
 */
public void init(Config cfg,MessageType t,TaskPlan taskPlan,int ed){
  this.edge=ed;
  this.thisSources=TaskPlanUtils.getTasksOfThisWorker(taskPlan,sources);
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor(),sources,destinations));
  this.thisTasks=taskPlan.getTasksOfThisExecutor();
  this.router=new PartitionRouter(taskPlan,sources,destinations);
  Map<Integer,Set<Integer>> internal=router.getInternalSendTasks(0);
  Map<Integer,Set<Integer>> external=router.getExternalSendTasks(0);
  this.instancePlan=taskPlan;
  this.dataType=t;
  if (this.receiveType == null) {
    this.receiveType=dataType;
  }
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor()));
  for (  int s : thisSources) {
    Set<Integer> integerSetMap=internal.get(s);
    if (integerSetMap != null) {
      this.dests.internal.addAll(integerSetMap);
    }
    Set<Integer> integerSetMap1=external.get(s);
    if (integerSetMap1 != null) {
      this.dests.external.addAll(integerSetMap1);
    }
    LOG.fine(String.format("String_Node_Str",taskPlan.getThisExecutor(),s));
    break;
  }
  LOG.log(Level.FINE,String.format("String_Node_Str",taskPlan.getThisExecutor()));
  if (this.finalReceiver != null && isLastReceiver()) {
    this.finalReceiver.init(cfg,this,receiveExpectedTaskIds());
  }
  if (this.partialReceiver != null) {
    this.partialReceiver.init(cfg,this,receiveExpectedTaskIds());
  }
  Map<Integer,ArrayBlockingQueue<Pair<Object,OutMessage>>> pendingSendMessagesPerSource=new HashMap<>();
  Map<Integer,Queue<Pair<Object,ChannelMessage>>> pendingReceiveMessagesPerSource=new HashMap<>();
  Map<Integer,Queue<ChannelMessage>> pendingReceiveDeSerializations=new HashMap<>();
  Map<Integer,MessageSerializer> serializerMap=new HashMap<>();
  Map<Integer,MessageDeSerializer> deSerializerMap=new HashMap<>();
  Set<Integer> srcs=TaskPlanUtils.getTasksOfThisWorker(taskPlan,sources);
  Set<Integer> tempsrcs=TaskPlanUtils.getTasksOfThisWorker(taskPlan,sources);
  for (  Integer src : tempsrcs) {
    srcs.add((src * -1) - 1);
  }
  for (  int s : srcs) {
    ArrayBlockingQueue<Pair<Object,OutMessage>> pendingSendMessages=new ArrayBlockingQueue<Pair<Object,OutMessage>>(DataFlowContext.sendPendingMax(cfg));
    pendingSendMessagesPerSource.put(s,pendingSendMessages);
    serializerMap.put(s,new MultiMessageSerializer(new KryoSerializer(),executor));
  }
  int maxReceiveBuffers=DataFlowContext.receiveBufferCount(cfg);
  int receiveExecutorsSize=receivingExecutors().size();
  if (receiveExecutorsSize == 0) {
    receiveExecutorsSize=1;
  }
  Set<Integer> execs=router.receivingExecutors();
  for (  int ex : execs) {
    int capacity=maxReceiveBuffers * 2 * receiveExecutorsSize;
    Queue<Pair<Object,ChannelMessage>> pendingReceiveMessages=new ArrayBlockingQueue<Pair<Object,ChannelMessage>>(capacity);
    pendingReceiveMessagesPerSource.put(ex,pendingReceiveMessages);
    pendingReceiveDeSerializations.put(ex,new ArrayBlockingQueue<ChannelMessage>(capacity));
    deSerializerMap.put(ex,new MultiMessageDeserializer(new KryoSerializer(),executor));
  }
  for (  int src : srcs) {
    for (    int dest : destinations) {
      sendRoutingParameters(src,dest);
    }
  }
  delegete.setCompletionListener(completionListener);
  delegete.init(cfg,t,receiveType,keyType,receiveKeyType,taskPlan,edge,router.receivingExecutors(),router.isLastReceiver(),this,pendingSendMessagesPerSource,pendingReceiveMessagesPerSource,pendingReceiveDeSerializations,serializerMap,deSerializerMap,isKeyed);
  delegete.setKeyType(keyType);
}