Program: 55893
Project: 55893
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void schedulJob(final ExecutionGraph executionGraph) throws SchedulingException {
  final Map<InstanceType,InstanceTypeDescription> availableInstances=getInstanceManager().getMapOfAvailableInstanceTypes();
  for (int i=0; i < executionGraph.getNumberOfStages(); i++) {
    final InstanceRequestMap instanceRequestMap=new InstanceRequestMap();
    final ExecutionStage stage=executionGraph.getStage(i);
    stage.collectRequiredInstanceTypes(instanceRequestMap,ExecutionState.CREATED);
    final Iterator<Map.Entry<InstanceType,Integer>> it=instanceRequestMap.getMinimumIterator();
    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");
      }
    }
  }
  executionGraph.registerJobStatusListener(this);
  final ExecutionGraphIterator it2=new ExecutionGraphIterator(executionGraph,true);
  while (it2.hasNext()) {
    final ExecutionVertex vertex=it2.next();
    vertex.registerExecutionListener(new QueueExecutionListener(this,vertex));
  }
  executionGraph.registerExecutionStageListener(this);
synchronized (this.jobQueue) {
    this.jobQueue.add(executionGraph);
    final ExecutionStage executionStage=executionGraph.getCurrentExecutionStage();
    try {
      requestInstances(executionStage);
    }
 catch (    InstanceException e) {
      final String exceptionMessage=StringUtils.stringifyException(e);
      LOG.error(exceptionMessage);
      this.jobQueue.remove(executionGraph);
      throw new SchedulingException(exceptionMessage);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void schedulJob(final ExecutionGraph executionGraph) throws SchedulingException {
synchronized (executionGraph) {
    final Map<InstanceType,InstanceTypeDescription> availableInstances=getInstanceManager().getMapOfAvailableInstanceTypes();
    for (int i=0; i < executionGraph.getNumberOfStages(); i++) {
      final InstanceRequestMap instanceRequestMap=new InstanceRequestMap();
      final ExecutionStage stage=executionGraph.getStage(i);
      stage.collectRequiredInstanceTypes(instanceRequestMap,ExecutionState.CREATED);
      final Iterator<Map.Entry<InstanceType,Integer>> it=instanceRequestMap.getMinimumIterator();
      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");
        }
      }
    }
    executionGraph.registerJobStatusListener(this);
    final ExecutionGraphIterator it2=new ExecutionGraphIterator(executionGraph,true);
    while (it2.hasNext()) {
      final ExecutionVertex vertex=it2.next();
      vertex.registerExecutionListener(new QueueExecutionListener(this,vertex));
    }
    executionGraph.registerExecutionStageListener(this);
  }
synchronized (this.jobQueue) {
    this.jobQueue.add(executionGraph);
  }
synchronized (executionGraph) {
    final ExecutionStage executionStage=executionGraph.getCurrentExecutionStage();
    try {
      requestInstances(executionStage);
    }
 catch (    InstanceException e) {
      final String exceptionMessage=StringUtils.stringifyException(e);
      LOG.error(exceptionMessage);
      this.jobQueue.remove(executionGraph);
      throw new SchedulingException(exceptionMessage);
    }
  }
}