Program: 55550
Project: 55550
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 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 Set<ChannelID> activeOutputChannels) throws IOException {
  if (id == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (environment == 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,this);
      }
    }
 else {
      if (runningTask instanceof RuntimeTask) {
        if (CheckpointUtils.hasPartialCheckpointAvailable(id)) {
          task=new ReplayTask((RuntimeTask)runningTask,this);
        }
 else {
          return null;
        }
      }
 else {
        registerTask=false;
      }
    }
    final Environment ee=task.getEnvironment();
    if (registerTask) {
      task.registerMemoryManager(this.memoryManager);
      task.registerIOManager(this.ioManager);
      task.registerInputSplitProvider(new TaskInputSplitProvider(ee.getJobID(),id,this.globalInputSplitProvider));
      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 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 Set<ChannelID> activeOutputChannels) throws IOException {
  if (id == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (environment == 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,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) {
      task.registerMemoryManager(this.memoryManager);
      task.registerIOManager(this.ioManager);
      task.registerInputSplitProvider(new TaskInputSplitProvider(ee.getJobID(),id,this.globalInputSplitProvider));
      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;
}