#fixed code
                              @Override
  public List<Task> assignTasks(TaskTracker taskTracker)
      throws IOException {
    HttpHost tracker = new HttpHost(taskTracker.getStatus().getHost(),
        taskTracker.getStatus().getHttpPort());

    if (!mesosTrackers.containsKey(tracker)) {
      LOG.info("Unknown/exited TaskTracker: " + tracker + ". ");
      return null;
    }

    MesosTracker mesosTracker = mesosTrackers.get(tracker);

    // Make sure we're not asked to assign tasks to any task trackers that have
    // been stopped. This could happen while the task tracker has not been
    // removed from the cluster e.g still in the heartbeat timeout period.
    synchronized (this) {
      if (mesosTracker.stopped) {
        LOG.info("Asked to assign tasks to stopped tracker " + tracker + ".");
        return null;
      }
    }

    // Let the underlying task scheduler do the actual task scheduling.
    List<Task> tasks = taskScheduler.assignTasks(taskTracker);

    // The Hadoop Fair Scheduler is known to return null.
    if (tasks == null) {
      return null;
    }

    // Keep track of which TaskTracker contains which tasks.
    for (Task task : tasks) {
      mesosTracker.jobs.add(task.getJobID());
    }

    return tasks;
  }
#vulnerable code 
                              @Override
  public List<Task> assignTasks(TaskTracker taskTracker)
      throws IOException {
    HttpHost tracker = new HttpHost(taskTracker.getStatus().getHost(),
        taskTracker.getStatus().getHttpPort());

    if (!mesosTrackers.containsKey(tracker)) {
      LOG.info("Unknown/exited TaskTracker: " + tracker + ". ");
      return null;
    }
    // Let the underlying task scheduler do the actual task scheduling.
    List<Task> tasks = taskScheduler.assignTasks(taskTracker);

    // The Hadoop Fair Scheduler is known to return null.
    if (tasks == null) {
      return null;
    }

    // Keep track of which TaskTracker contains which tasks.
    for (Task task : tasks) {
      mesosTrackers.get(tracker).jobs.add(task.getJobID());
    }

    return tasks;
  } 
                            #location 12 
                            #vulnerability type THREAD_SAFETY_VIOLATION