boolean (@NotNull PsiReference ref, @Nullable PsiElement refElement, @NotNull PsiMethod method, @NotNull Processor<? super PsiReference> consumer) { if (refElement instanceof PsiMethod refMethod) { PsiClass refMethodClass = refMethod.getContainingClass(); if (refMethodClass == null) return true; if (!refMethod.hasModifierProperty(PsiModifier.STATIC)) { PsiSubstitutor substitutor = TypeConversionUtil.getClassSubstitutor(myContainingClass, refMethodClass, PsiSubstitutor.EMPTY); if (substitutor != null) { MethodSignature superSignature = method.getSignature(substitutor); MethodSignature refSignature = refMethod.getSignature(PsiSubstitutor.EMPTY); if (MethodSignatureUtil.isSubsignature(superSignature, refSignature)) { if (!consumer.process(ref)) return false; } } } if (!myStrictSignatureSearch) { PsiManager manager = method.getManager(); if (manager.areElementsEquivalent(refMethodClass, myContainingClass)) { return consumer.process(ref); } } } return true; }