boolean (@NotNull PsiExpression expression, @NotNull PsiCall psiCallExpression) { PsiExpressionList list = psiCallExpression.getArgumentList(); assert list != null; int index = ArrayUtil.indexOf(list.getExpressions(), expression); String methodName; if (psiCallExpression instanceof PsiMethodCallExpression) { String referenceName = ((PsiMethodCallExpression)psiCallExpression).getMethodExpression().getReferenceName(); if ("super".equals(referenceName) || "this".equals(referenceName)) { // constructor call PsiClass psiClass = PsiTreeUtil.getParentOfType(psiCallExpression, PsiClass.class, true); PsiClass psiTargetClass = "super".equals(referenceName)? psiClass == null ? null : psiClass.getSuperClass() : psiClass; methodName = psiTargetClass == null? null : psiTargetClass.getName(); } else { methodName = referenceName; } } else if (psiCallExpression instanceof PsiNewExpression) { PsiJavaCodeReferenceElement classRef = ((PsiNewExpression)psiCallExpression).getClassOrAnonymousClassReference(); methodName = classRef == null ? null : classRef.getReferenceName(); } else if (psiCallExpression instanceof PsiEnumConstant) { PsiMethod method = psiCallExpression.resolveMethod(); methodName = method != null ? method.getName() : null; } else { methodName = null; } if (methodName != null && index >= 0 && areThereInjectionsWithName(methodName, false)) { PsiMethod method = psiCallExpression.resolveMethod(); if (method != null) { PsiParameter[] parameters = method.getParameterList().getParameters(); if (index < parameters.length) { process(parameters[index], method, index); } else if (method.isVarArgs()) { process(parameters[parameters.length - 1], method, parameters.length - 1); } } } return false; }