List<Task> (@Nullable String request, int offset, int limit, boolean withClosed, boolean forceRequest, @NotNull final ProgressIndicator cancelled) { List<Task> issues = null; for (final TaskRepository repository : getAllRepositories()) { if (!repository.isConfigured() || (!forceRequest && myBadRepositories.contains(repository))) { continue; } try { long start = System.currentTimeMillis(); TaskManagementUsageCollector.logCollectRemoteTasks(myProject, repository); Task[] tasks = repository.getIssues(request, offset, limit, withClosed, cancelled); long timeSpent = System.currentTimeMillis() - start; LOG.debug(String.format("Total %s ms to download %d issues from '%s' (pattern '%s')", timeSpent, tasks.length, repository.getUrl(), request)); myBadRepositories.remove(repository); if (issues == null) issues = new ArrayList<>(tasks.length); if (!repository.isSupported(TaskRepository.NATIVE_SEARCH) && request != null) { List<Task> filteredTasks = TaskUtil.filterTasks(request, Arrays.asList(tasks)); issues.addAll(filteredTasks); } else { ContainerUtil.addAll(issues, tasks); } } catch (ProcessCanceledException ignored) { // OK } catch (Exception e) { String reason = ""; // Fix to IDEA-111810 //noinspection InstanceofCatchParameter if (e.getClass() == Exception.class || e instanceof RequestFailedException) { // probably contains some message meaningful to end-user reason = e.getMessage(); } //noinspection InstanceofCatchParameter if (e instanceof SocketTimeoutException || e instanceof HttpRequests.HttpStatusException) { LOG.warn("Can't connect to " + repository + ": " + e.getMessage()); } else { LOG.warn("Cannot connect to " + repository, e); } myBadRepositories.add(repository); if (forceRequest) { throw new RequestFailedException(repository, reason); } } } return issues; }