void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (checkScanner) { if (!MethodCallUtils.isCallToMethod(expression, CommonClassNames.JAVA_UTIL_ITERATOR, null, SCANNER_PATTERN)) { return; } } else { if (!MethodCallUtils.isCallToMethod(expression, CommonClassNames.JAVA_UTIL_ITERATOR, null, HardcodedMethodConstants.NEXT) && !MethodCallUtils.isCallToMethod(expression, "java.util.ListIterator", null, "previous")) { return; } } if (checkTarget) { final PsiReferenceExpression methodExpression = expression.getMethodExpression(); final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (!(qualifier instanceof PsiReferenceExpression referenceExpression)) { if (target != null) { return; } if (qualifier != null && !(qualifier instanceof PsiThisExpression) && !(qualifier instanceof PsiSuperExpression)) { return; } } else { final PsiElement element = referenceExpression.resolve(); if (target == null || !target.equals(element)) { return; } } } illegalCall = expression; stopWalking(); }