UsageType (PsiElement element) { if (element instanceof PsiReferenceExpression) { final PsiMethod containerMethod = PsiTreeUtil.getParentOfType(element, PsiMethod.class); if (containerMethod != null) { final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)element; final PsiExpression qualifier = referenceExpression.getQualifierExpression(); final PsiElement p = referenceExpression.getParent(); if (p instanceof PsiMethodCallExpression callExpression) { final PsiMethod calledMethod = callExpression.resolveMethod(); if (calledMethod == containerMethod) { return UsageType.RECURSION; } if (qualifier != null && !(qualifier instanceof PsiThisExpression) && calledMethod != null) { if (Objects.equals(containerMethod.getName(), calledMethod.getName()) && haveCommonSuperMethod(containerMethod, calledMethod)) { boolean parametersDelegated = parametersDelegated(containerMethod, callExpression); if (qualifier instanceof PsiSuperExpression) { return parametersDelegated ? UsageType.DELEGATE_TO_SUPER : UsageType.DELEGATE_TO_SUPER_PARAMETERS_CHANGED; } else { return parametersDelegated ? UsageType.DELEGATE_TO_ANOTHER_INSTANCE : UsageType.DELEGATE_TO_ANOTHER_INSTANCE_PARAMETERS_CHANGED; } } } } } } return null; }