public <T extends TaskRepository> void setRepositories(@NotNull List<T> repositories) {
    Set<TaskRepository> set = new HashSet<>(myRepositories);
    repositories.forEach(set::remove);
    myBadRepositories.removeAll(set); // remove all changed reps
    myIssueCache.clear();

    myRepositories.clear();
    myRepositories.addAll(repositories);

    List<TaskProjectConfiguration.SharedServer> servers = getProjectConfiguration().servers;
    servers.clear();
    reps:
    for (T repository : repositories) {
      if (repository.isShared() && repository.getUrl() != null) {
        TaskRepositoryType type = repository.getRepositoryType();
        for (TaskProjectConfiguration.SharedServer server : servers) {
          if (repository.getUrl().equals(server.url) && type.getName().equals(server.type)) {
            continue reps;
          }
        }
        TaskProjectConfiguration.SharedServer server = new TaskProjectConfiguration.SharedServer();
        server.type = type.getName();
        server.url = repository.getUrl();
        servers.add(server);
      }
    }

    clearNonExistentRepositoriesFromTasks();
  }
public <T extends TaskRepository> void setRepositories(@NotNull List<T> repositories)