PsiMethod (@NotNull PsiClass aClass, @NotNull MethodSignature methodSignature, boolean checkBases) { String name = methodSignature.isConstructor() ? aClass.getName() : methodSignature.getName(); if (name == null) return null; List<Pair<PsiMethod, PsiSubstitutor>> pairs = aClass.findMethodsAndTheirSubstitutorsByName(name, checkBases); for (Pair<PsiMethod, PsiSubstitutor> pair : pairs) { PsiMethod method = pair.first; PsiSubstitutor substitutor = pair.second; MethodSignature foundMethodSignature = method.getSignature(substitutor); if (methodSignature.equals(foundMethodSignature)) return method; } return null; }