Program: 173028
Project: 173028
Buggy source:
@Override public void progress(){
  for (  int t : messages.keySet()) {
    boolean canProgress=true;
    Map<Integer,Queue<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,Queue<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,Queue<Object>> e : messagePerTarget.entrySet()) {
          if (previous == null) {
            previous=e.getValue().poll();
          }
 else {
            Object current=e.getValue().poll();
            previous=reduceFunction.reduce(previous,current);
          }
        }
        if (previous != null) {
          reducedValues.offer(previous);
        }
        progressAttempts=0;
      }
 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;
        }
      }
    }
  }
}

Fixed version (ground truth):
@Override public void progress(){
  for (  int t : messages.keySet()) {
    boolean canProgress=true;
    Map<Integer,Queue<Object>> messagePerTarget=messages.get(t);
    Map<Integer,Integer> countsPerTarget=counts.get(t);
    Map<Integer,Integer> totalCountMap=totalCounts.get(t);
    Queue<Object> reducedValues=this.reducedValuesMap.get(t);
    while (canProgress) {
      boolean found=true;
      for (      Map.Entry<Integer,Queue<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,Queue<Object>> e : messagePerTarget.entrySet()) {
          if (previous == null) {
            previous=e.getValue().poll();
          }
 else {
            Object current=e.getValue().poll();
            previous=reduceFunction.reduce(previous,current);
          }
        }
        if (previous != null) {
          reducedValues.offer(previous);
        }
        progressAttempts=0;
      }
 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;
        }
      }
    }
  }
}