Program: 55238
Project: 55238
Buggy source:
/** 
 * Registers an newly incoming runtime task with the task manager.
 * @param id the ID of the task to register
 * @param jobConfiguration the job configuration that has been attached to the original job graph
 * @param environment the environment of the task to be registered
 * @param initialCheckpointState the task's initial checkpoint state
 * @param activeOutputChannels the set of initially active output channels
 * @return the task to be started or <code>null</code> if a task with the same ID was already running
 */
private Task createAndRegisterTask(final ExecutionVertexID id,final Configuration jobConfiguration,final RuntimeEnvironment environment,final CheckpointState initialCheckpointState,final Set<ChannelID> activeOutputChannels) throws InsufficientResourcesException, IOException {
  if (id == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (environment == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (initialCheckpointState == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Task task=null;
synchronized (this) {
    final Task runningTask=this.runningTasks.get(id);
    boolean registerTask=true;
    if (runningTask == null) {
      if (CheckpointUtils.hasCompleteCheckpointAvailable(id)) {
        task=new ReplayTask(id,environment,this);
      }
 else {
        task=new RuntimeTask(id,environment,initialCheckpointState,this);
      }
    }
 else {
      if (runningTask instanceof RuntimeTask) {
        if (CheckpointUtils.hasPartialCheckpointAvailable(id)) {
          task=new ReplayTask((RuntimeTask)runningTask,this);
        }
 else {
          return null;
        }
      }
 else {
        task=runningTask;
        registerTask=false;
      }
    }
    final Environment ee=task.getEnvironment();
    if (registerTask) {
      this.byteBufferedChannelManager.register(task,activeOutputChannels);
      boolean enableProfiling=false;
      if (this.profiler != null && jobConfiguration.getBoolean(ProfilingUtils.PROFILE_JOB_KEY,true)) {
        enableProfiling=true;
      }
      if (enableProfiling) {
        task.registerProfiler(this.profiler,jobConfiguration);
      }
      if (!this.taskManagerPlugins.isEmpty()) {
        final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
        while (it.hasNext()) {
          it.next().registerTask(id,jobConfiguration,ee);
        }
      }
      this.runningTasks.put(id,task);
    }
  }
  return task;
}

Fixed version (ground truth):
/** 
 * Registers an newly incoming runtime task with the task manager.
 * @param id the ID of the task to register
 * @param jobConfiguration the job configuration that has been attached to the original job graph
 * @param environment the environment of the task to be registered
 * @param initialCheckpointState the task's initial checkpoint state
 * @param activeOutputChannels the set of initially active output channels
 * @return the task to be started or <code>null</code> if a task with the same ID was already running
 */
private Task createAndRegisterTask(final ExecutionVertexID id,final Configuration jobConfiguration,final RuntimeEnvironment environment,final CheckpointState initialCheckpointState,final Set<ChannelID> activeOutputChannels) throws InsufficientResourcesException, IOException {
  if (id == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (environment == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (initialCheckpointState == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  Task task=null;
synchronized (this) {
    final Task runningTask=this.runningTasks.get(id);
    if (runningTask == null) {
      if (CheckpointUtils.hasCompleteCheckpointAvailable(id)) {
        task=new ReplayTask(id,environment,this);
      }
 else {
        task=new RuntimeTask(id,environment,initialCheckpointState,this);
      }
    }
 else {
      if (CheckpointUtils.hasPartialCheckpointAvailable(id)) {
        task=new ReplayTask((RuntimeTask)runningTask,this);
      }
 else {
        return null;
      }
    }
    final Environment ee=task.getEnvironment();
    this.byteBufferedChannelManager.register(task,activeOutputChannels);
    boolean enableProfiling=false;
    if (this.profiler != null && jobConfiguration.getBoolean(ProfilingUtils.PROFILE_JOB_KEY,true)) {
      enableProfiling=true;
    }
    if (enableProfiling) {
      task.registerProfiler(this.profiler,jobConfiguration);
    }
    if (!this.taskManagerPlugins.isEmpty()) {
      final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
      while (it.hasNext()) {
        it.next().registerTask(id,jobConfiguration,ee);
      }
    }
    this.runningTasks.put(id,task);
  }
  return task;
}