Program: 55840
Project: 55840
Buggy source:
/** 
 * @param failed
 * @return
 */
private List<ExecutionVertex> findRestarts(ExecutionVertex failed){
  LOG.info("String_Node_Str");
  ArrayList<ExecutionVertex> restart=new ArrayList<ExecutionVertex>();
  Queue<ExecutionVertex> totest=new ArrayDeque<ExecutionVertex>();
  ArrayList<ExecutionVertex> visited=new ArrayList<ExecutionVertex>();
  totest.add(failed);
  int k=0;
  LOG.info("String_Node_Str");
  ExecutionVertex vertex=failed;
  while (!totest.isEmpty()) {
    LOG.info("String_Node_Str");
    if (k != 0) {
      vertex=totest.peek();
    }
    LOG.info("String_Node_Str" + vertex.getName());
    k++;
    totest.remove(vertex);
    if (!restart.contains(vertex)) {
      restart.add(vertex);
    }
    for (int i=0; i < vertex.getNumberOfSuccessors(); i++) {
      ExecutionVertex successor=vertex.getSuccessor(i);
      restart.add(successor);
      LOG.info("String_Node_Str" + successor.getName() + "String_Node_Str");
      if (successor.getCheckpointState() == CheckpointState.PARTIAL) {
        this.checkpoints.remove(successor);
      }
      List<ExecutionVertex> follower=findFollowers(successor,restart);
      restart.addAll(follower);
      Iterator<ExecutionVertex> iter=follower.iterator();
      while (iter.hasNext()) {
        ExecutionVertex follow=iter.next();
        if (!visited.contains(follow)) {
          LOG.info("String_Node_Str" + follow.getName());
          totest.add(follow);
        }
      }
    }
    for (int j=0; j < vertex.getNumberOfPredecessors(); j++) {
      ExecutionVertex predecessor=vertex.getPredecessor(j);
      if (predecessor.getCheckpointState() != CheckpointState.PARTIAL) {
        LOG.info("String_Node_Str" + predecessor.getName() + "String_Node_Str");
        restart.add(predecessor);
        if (!visited.contains(predecessor)) {
          totest.add(predecessor);
          LOG.info("String_Node_Str" + predecessor);
        }
      }
 else {
        if (!this.globalConsistentCheckpoint.contains(predecessor)) {
          this.globalConsistentCheckpoint.add(predecessor);
        }
        List<ExecutionVertex> follower=findFollowers(predecessor,restart);
        for (int i=0; i < follower.size(); i++) {
          LOG.info("String_Node_Str" + follower.get(i) + "String_Node_Str");
        }
        restart.addAll(follower);
        Iterator<ExecutionVertex> iter=follower.iterator();
        while (iter.hasNext()) {
          ExecutionVertex follow=iter.next();
          if (!visited.contains(follow)) {
            LOG.info("String_Node_Str" + follow.getName());
            totest.add(follow);
          }
        }
      }
    }
    visited.add(vertex);
  }
  LOG.info("String_Node_Str");
  return restart;
}

Fixed version (ground truth):
/** 
 * @param failed
 * @return
 */
private List<ExecutionVertex> findRestarts(ExecutionVertex failed){
  ArrayList<ExecutionVertex> restart=new ArrayList<ExecutionVertex>();
  Queue<ExecutionVertex> totest=new ArrayDeque<ExecutionVertex>();
  ArrayList<ExecutionVertex> visited=new ArrayList<ExecutionVertex>();
  totest.add(failed);
  ExecutionVertex vertex=failed;
  while (!totest.isEmpty()) {
    vertex=totest.peek();
    totest.remove(vertex);
    if (!restart.contains(vertex)) {
      restart.add(vertex);
    }
    for (int i=0; i < vertex.getNumberOfSuccessors(); i++) {
      ExecutionVertex successor=vertex.getSuccessor(i);
      restart.add(successor);
      if (successor.getCheckpointState() == CheckpointState.PARTIAL) {
        this.checkpoints.remove(successor);
        this.globalConsistentCheckpoint.remove(successor.getID());
      }
      List<ExecutionVertex> follower=findFollowers(successor,restart);
      restart.addAll(follower);
      Iterator<ExecutionVertex> iter=follower.iterator();
      while (iter.hasNext()) {
        ExecutionVertex follow=iter.next();
        if (!visited.contains(follow)) {
          totest.add(follow);
        }
      }
    }
    for (int j=0; j < vertex.getNumberOfPredecessors(); j++) {
      ExecutionVertex predecessor=vertex.getPredecessor(j);
      if (predecessor.getCheckpointState() != CheckpointState.PARTIAL) {
        restart.add(predecessor);
        if (!visited.contains(predecessor)) {
          totest.add(predecessor);
        }
      }
 else {
        if (!this.globalConsistentCheckpoint.contains(predecessor.getID())) {
          this.globalConsistentCheckpoint.add(predecessor.getID());
        }
        List<ExecutionVertex> follower=findFollowers(predecessor,restart);
        for (int i=0; i < follower.size(); i++) {
          LOG.info("String_Node_Str" + follower.get(i) + "String_Node_Str");
        }
        restart.addAll(follower);
        Iterator<ExecutionVertex> iter=follower.iterator();
        while (iter.hasNext()) {
          ExecutionVertex follow=iter.next();
          if (!visited.contains(follow)) {
            LOG.info("String_Node_Str" + follow.getName());
            totest.add(follow);
          }
        }
      }
    }
    visited.add(vertex);
  }
  LOG.info("String_Node_Str");
  return restart;
}