Program: 55816
Project: 55816
Buggy source:
/** 
 * Checks which instance types and how many instances of these types are required to execute this stage of the job graph. The required instance types and the number of instances are collected in the given map. Note that this method does not clear the map before collecting the instances.
 * @param instanceRequestMap the map containing the instances types and the required number of instances of the respective type
 * @param executionState the execution state the considered vertices must be in
 */
public void collectRequiredInstanceTypes(final InstanceRequestMap instanceRequestMap,final ExecutionState executionState){
  final Set<AbstractInstance> collectedInstances=new HashSet<AbstractInstance>();
  for (int i=0; i < getNumberOfStageMembers(); i++) {
    final ExecutionGroupVertex groupVertex=getStageMember(i);
    for (int j=0; j < groupVertex.getCurrentNumberOfGroupMembers(); j++) {
      final ExecutionVertex vertex=groupVertex.getGroupMember(j);
      if (vertex.getExecutionState() == executionState) {
        final AbstractInstance instance=vertex.getAllocatedResource().getInstance();
        if (collectedInstances.contains(instance)) {
          continue;
        }
 else {
          collectedInstances.add(instance);
        }
        if (instance instanceof DummyInstance) {
          final InstanceType instanceType=instance.getType();
          int num=instanceRequestMap.getMaximumNumberOfInstances(instanceType);
          ++num;
          instanceRequestMap.setMaximumNumberOfInstances(instanceType,num);
          if (groupVertex.isInputVertex()) {
            num=instanceRequestMap.getMinimumNumberOfInstances(instanceType);
            ++num;
            instanceRequestMap.setMinimumNumberOfInstances(instanceType,num);
          }
        }
 else {
          LOG.debug("String_Node_Str" + vertex.getName() + "String_Node_Str"+ vertex.getID()+ "String_Node_Str");
        }
      }
    }
  }
  final Iterator<Map.Entry<InstanceType,Integer>> it=instanceRequestMap.getMaximumIterator();
  while (it.hasNext()) {
    final Map.Entry<InstanceType,Integer> entry=it.next();
    if (instanceRequestMap.getMinimumNumberOfInstances(entry.getKey()) == 0) {
      instanceRequestMap.setMinimumNumberOfInstances(entry.getKey(),entry.getValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Checks which instance types and how many instances of these types are required to execute this stage of the job graph. The required instance types and the number of instances are collected in the given map. Note that this method does not clear the map before collecting the instances.
 * @param instanceRequestMap the map containing the instances types and the required number of instances of the respective type
 * @param executionState the execution state the considered vertices must be in
 */
public void collectRequiredInstanceTypes(final InstanceRequestMap instanceRequestMap,final ExecutionState executionState){
  final Set<AbstractInstance> collectedInstances=new HashSet<AbstractInstance>();
  final ExecutionGroupVertexIterator groupIt=new ExecutionGroupVertexIterator(this.getExecutionGraph(),true,this.stageNum);
  while (groupIt.hasNext()) {
    final ExecutionGroupVertex groupVertex=groupIt.next();
    System.out.println("String_Node_Str" + groupVertex.getName());
    for (int j=0; j < groupVertex.getCurrentNumberOfGroupMembers(); j++) {
      final ExecutionVertex vertex=groupVertex.getGroupMember(j);
      if (vertex.getExecutionState() == executionState) {
        final AbstractInstance instance=vertex.getAllocatedResource().getInstance();
        if (collectedInstances.contains(instance)) {
          continue;
        }
 else {
          collectedInstances.add(instance);
        }
        if (instance instanceof DummyInstance) {
          final InstanceType instanceType=instance.getType();
          int num=instanceRequestMap.getMaximumNumberOfInstances(instanceType);
          ++num;
          instanceRequestMap.setMaximumNumberOfInstances(instanceType,num);
          if (groupVertex.isInputVertex()) {
            num=instanceRequestMap.getMinimumNumberOfInstances(instanceType);
            ++num;
            instanceRequestMap.setMinimumNumberOfInstances(instanceType,num);
          }
        }
 else {
          LOG.debug("String_Node_Str" + vertex.getName() + "String_Node_Str"+ vertex.getID()+ "String_Node_Str");
        }
      }
    }
  }
  final Iterator<Map.Entry<InstanceType,Integer>> it=instanceRequestMap.getMaximumIterator();
  while (it.hasNext()) {
    final Map.Entry<InstanceType,Integer> entry=it.next();
    if (instanceRequestMap.getMinimumNumberOfInstances(entry.getKey()) == 0) {
      instanceRequestMap.setMinimumNumberOfInstances(entry.getKey(),entry.getValue());
    }
  }
}