Program: 173034
Project: 173034
Buggy source:
@Override public void progress(){
  for (  int t : messages.keySet()) {
    if (batchDone.get(t)) {
      continue;
    }
    boolean canProgress=true;
    while (canProgress) {
      Map<Integer,List<Object>> map=messages.get(t);
      Map<Integer,Boolean> finishedForTarget=finished.get(t);
      Map<Integer,Integer> countMap=counts.get(t);
      boolean found=true;
      boolean allFinished=true;
      for (      Map.Entry<Integer,List<Object>> e : map.entrySet()) {
        if (e.getValue().size() == 0 && !finishedForTarget.get(e.getKey())) {
          found=false;
          canProgress=false;
        }
        if (!finishedForTarget.get(e.getKey())) {
          allFinished=false;
        }
      }
      if (found) {
        List<Object> out=new ArrayList<>();
        for (        Map.Entry<Integer,List<Object>> e : map.entrySet()) {
          List<Object> valueList=e.getValue();
          if (valueList.size() > 0) {
            Object value=valueList.get(0);
            out.add(value);
          }
        }
        int flags=0;
        if (allFinished) {
          boolean last=true;
          for (          Map.Entry<Integer,List<Object>> e : map.entrySet()) {
            List<Object> valueList=e.getValue();
            if (valueList.size() > 1) {
              last=false;
            }
          }
          if (last) {
            flags=MessageFlags.FLAGS_LAST;
          }
        }
        if (dataFlowOperation.sendPartial(t,out,flags,destination)) {
          boolean allZero=true;
          for (          Map.Entry<Integer,List<Object>> e : map.entrySet()) {
            List<Object> value=e.getValue();
            if (value.size() > 0) {
              value.remove(0);
            }
            if (value.size() != 0) {
              allZero=false;
            }
          }
          for (          Map.Entry<Integer,Integer> e : countMap.entrySet()) {
            Integer i=e.getValue();
            e.setValue(i - 1);
          }
          if (allFinished && allZero) {
            batchDone.put(t,true);
            break;
          }
        }
 else {
          canProgress=false;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void progress(){
  for (  int t : messages.keySet()) {
    if (batchDone.get(t)) {
      continue;
    }
    boolean canProgress=true;
    while (canProgress) {
      Map<Integer,Queue<Object>> map=messages.get(t);
      Map<Integer,Boolean> finishedForTarget=finished.get(t);
      Map<Integer,Integer> countMap=counts.get(t);
      boolean found=true;
      boolean allFinished=true;
      for (      Map.Entry<Integer,Queue<Object>> e : map.entrySet()) {
        if (e.getValue().size() == 0 && !finishedForTarget.get(e.getKey())) {
          found=false;
          canProgress=false;
        }
        if (!finishedForTarget.get(e.getKey())) {
          allFinished=false;
        }
      }
      if (found) {
        List<Object> out=new ArrayList<>();
        for (        Map.Entry<Integer,Queue<Object>> e : map.entrySet()) {
          Queue<Object> valueList=e.getValue();
          if (valueList.size() > 0) {
            Object value=valueList.peek();
            out.add(value);
          }
        }
        int flags=0;
        if (allFinished) {
          boolean last=true;
          for (          Map.Entry<Integer,Queue<Object>> e : map.entrySet()) {
            Queue<Object> valueList=e.getValue();
            if (valueList.size() > 1) {
              last=false;
            }
          }
          if (last) {
            flags=MessageFlags.FLAGS_LAST;
          }
        }
        if (dataFlowOperation.sendPartial(t,out,flags,destination)) {
          boolean allZero=true;
          for (          Map.Entry<Integer,Queue<Object>> e : map.entrySet()) {
            Queue<Object> value=e.getValue();
            if (value.size() > 0) {
              value.poll();
            }
            if (value.size() != 0) {
              allZero=false;
            }
          }
          for (          Map.Entry<Integer,Integer> e : countMap.entrySet()) {
            Integer i=e.getValue();
            e.setValue(i - 1);
          }
          if (allFinished && allZero) {
            batchDone.put(t,true);
            break;
          }
        }
 else {
          canProgress=false;
        }
      }
    }
  }
}