void () { Map<RepositoryNode, MyRepoModel<?, ?, ?>> priorityLoading = new LinkedHashMap<>(); Map<RepositoryNode, MyRepoModel<?, ?, ?>> others = new LinkedHashMap<>(); RepositoryNode nodeForCurrentEditor = findNodeByRepo(myCurrentlyOpenedRepository); if (nodeForCurrentEditor != null) { MyRepoModel<?, ?, ?> currentRepoModel = myView2Model.get(nodeForCurrentEditor); //for ASYNC with no preselected -> check current repo if (isPreChecked(currentRepoModel) || myPreselectedRepositories.isEmpty()) { // put current editor repo to be loaded at first priorityLoading.put(nodeForCurrentEditor, currentRepoModel); currentRepoModel.setChecked(true); } } for (Map.Entry<RepositoryNode, MyRepoModel<Repository, PushSource, PushTarget>> entry : myView2Model.entrySet()) { MyRepoModel<?, ?, ?> model = entry.getValue(); RepositoryNode repoNode = entry.getKey(); if (isPreChecked(model)) { priorityLoading.putIfAbsent(repoNode, model); model.setChecked(true); } else if (model.getSupport().shouldRequestIncomingChangesForNotCheckedRepositories()) { others.put(repoNode, model); } } if (myPreselectedRepositories.isEmpty()) { boolean shouldScrollTo = myView2Model.values().stream().noneMatch(MyRepoModel::isSelected); myPushLog.highlightNodeOrFirst(nodeForCurrentEditor, shouldScrollTo); } loadCommitsFromMap(priorityLoading); loadCommitsFromMap(others); }