boolean ( PsiMethodCallExpression exp, PsiMethod method) { final PsiReferenceExpression methodExpression = exp.getMethodExpression(); final PsiMethod referencedMethod = exp.resolveMethod(); if (referencedMethod == null) { return false; } if (methodCallExpressionIndirectDefinitelyRecurses(exp, method)) { return true; } if (referencedMethod.equals(method)) { if (method.hasModifierProperty(PsiModifier.STATIC) || method.hasModifierProperty(PsiModifier.PRIVATE)) { return true; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (qualifier == null || qualifier instanceof PsiThisExpression) { return true; } } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (expressionDefinitelyRecurses(qualifier, method)) { return true; } final PsiExpressionList argumentList = exp.getArgumentList(); final PsiExpression[] args = argumentList.getExpressions(); for (final PsiExpression arg : args) { if (expressionDefinitelyRecurses(arg, method)) { return true; } } return false; }