void () { Set<PsiFile> deps = new HashSet<>(); Set<PsiFile> scope = getSelectedScope(myLeftTree); myIllegalsInRightTree = new HashSet<>(); for (PsiFile psiFile : scope) { Map<DependencyRule, Set<PsiFile>> illegalDeps = myIllegalDependencies.get(psiFile.getVirtualFile()); if (illegalDeps != null) { for (final DependencyRule rule : illegalDeps.keySet()) { final Set<PsiFile> files = illegalDeps.get(rule); for (PsiFile file : files) { myIllegalsInRightTree.add(file.getVirtualFile()); } } } final Set<PsiFile> psiFiles = myDependencies.get(psiFile); if (psiFiles != null) { for (PsiFile file : psiFiles) { if (file != null && file.isValid()) { deps.add(file); } } } } deps.removeAll(scope); replaceModel(myRightTree, buildTreeModel(deps, myRightTreeMarker), myRightTreeExpansionMonitor); expandFirstLevel(myRightTree); }