Collection<PsiMethod> (@NotNull PsiMethod method, PsiClass aClass, @NotNull Collection<? extends PsiElement> ignore) { ThreadingAssertions.assertEventDispatchThread(); assert !ApplicationManager.getApplication().isWriteAccessAllowed(); final Collection<PsiMethod> superMethods = DeepestSuperMethodsSearch.search(method).findAll(); superMethods.removeAll(ignore); if (superMethods.isEmpty()) { VirtualFile virtualFile = PsiUtilCore.getVirtualFile(aClass); if (virtualFile != null && ProjectRootManager.getInstance(aClass.getProject()).getFileIndex().isInSourceContent(virtualFile)) { PsiMethod[] siblingSuperMethod = new PsiMethod[1]; if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(()->{ siblingSuperMethod[0] = ReadAction.compute(()->FindSuperElementsHelper.getSiblingInheritedViaSubClass(method)); }, JavaBundle.message("progress.title.searching.for.sub.classes"), true, aClass.getProject())) { throw new ProcessCanceledException(); } if (siblingSuperMethod[0] != null) { superMethods.add(siblingSuperMethod[0]); superMethods.add(method); // add original method too because sometimes FindUsages can't find usages of this method by sibling super method } } } return superMethods; }