I'm trying to get method overrides if any present. I do the following:
PsiMethod myMethod = psiClass.findMethodsByName("myMethod", true).findFirst().orElse(null);
Collection<PsiMethod> overrides = OverridingMethodsSearch.search(myMethod, psiClass.getUseScope(), false).findAll();
The problem is that overrides also contains methods from different classes of the same java file. I'm checking it by the calling of
How should I define the search scope to consider only specified class methods?