Program: 56222
Project: 56222
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void schedulJob(ExecutionGraph executionGraph) throws SchedulingException {
  final Map<InstanceType,InstanceTypeDescription> availableInstances=this.instanceManager.getMapOfAvailableInstanceTypes();
  for (int i=0; i < executionGraph.getNumberOfStages(); i++) {
    final Map<InstanceType,Integer> requiredInstanceTypes=new HashMap<InstanceType,Integer>();
    executionGraph.collectInstanceTypesRequiredForStage(i,requiredInstanceTypes,ExecutionState.CREATED);
    final Iterator<Map.Entry<InstanceType,Integer>> it=requiredInstanceTypes.entrySet().iterator();
    while (it.hasNext()) {
      final Map.Entry<InstanceType,Integer> entry=it.next();
      final InstanceTypeDescription descr=availableInstances.get(entry.getKey());
      if (descr == null) {
        throw new SchedulingException("String_Node_Str" + entry.getKey() + "String_Node_Str");
      }
      if (descr.getMaximumNumberOfAvailableInstances() != -1 && descr.getMaximumNumberOfAvailableInstances() < entry.getValue().intValue()) {
        throw new SchedulingException("String_Node_Str" + entry.getValue().intValue() + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ descr.getMaximumNumberOfAvailableInstances()+ "String_Node_Str");
      }
    }
  }
synchronized (this.jobQueue) {
    this.jobQueue.add(executionGraph);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void schedulJob(ExecutionGraph executionGraph) throws SchedulingException {
  final Map<InstanceType,InstanceTypeDescription> availableInstances=this.instanceManager.getMapOfAvailableInstanceTypes();
  for (int i=0; i < executionGraph.getNumberOfStages(); i++) {
    final Map<InstanceType,Integer> requiredInstanceTypes=new HashMap<InstanceType,Integer>();
    executionGraph.collectInstanceTypesRequiredForStage(i,requiredInstanceTypes,ExecutionState.CREATED);
    final Iterator<Map.Entry<InstanceType,Integer>> it=requiredInstanceTypes.entrySet().iterator();
    while (it.hasNext()) {
      final Map.Entry<InstanceType,Integer> entry=it.next();
      final InstanceTypeDescription descr=availableInstances.get(entry.getKey());
      if (descr == null) {
        throw new SchedulingException("String_Node_Str" + entry.getKey() + "String_Node_Str");
      }
      if (descr.getMaximumNumberOfAvailableInstances() != -1 && descr.getMaximumNumberOfAvailableInstances() < entry.getValue().intValue()) {
        throw new SchedulingException("String_Node_Str" + entry.getValue().intValue() + "String_Node_Str"+ entry.getKey()+ "String_Node_Str"+ descr.getMaximumNumberOfAvailableInstances()+ "String_Node_Str");
      }
    }
  }
  final ExecutionGraphIterator it2=new ExecutionGraphIterator(executionGraph,true);
  while (it2.hasNext()) {
    final ExecutionVertex vertex=it2.next();
    if (vertex.getExecutionState() != ExecutionState.CREATED) {
      LOG.error("String_Node_Str" + vertex + "String_Node_Str"+ vertex.getExecutionState()+ "String_Node_Str"+ ExecutionState.CREATED);
    }
    vertex.getEnvironment().registerExecutionListener(new QueueExecutionListener(this,vertex));
    vertex.setExecutionState(ExecutionState.SCHEDULED);
  }
synchronized (this.jobQueue) {
    this.jobQueue.add(executionGraph);
  }
}