private void clearNonExistentRepositoriesFromTasks() {
    for (LocalTaskImpl task : myTasks.values()) {
      TaskRepository repository = task.getRepository();
      if (repository != null && !myRepositories.contains(repository)) {
        task.setRepository(null);
      }
    }
  }
private void clearNonExistentRepositoriesFromTasks()