void (@NotNull PsiMethodCallExpression call) { if (!STRING_COMPARISON_METHODS.test(call)) return; PsiExpression arg = ArrayUtil.getFirstElement(call.getArgumentList().getExpressions()); PsiExpression qualifier = call.getMethodExpression().getQualifierExpression(); StringCase argCase = fromExpression(arg, ANALYSIS_COMPLEXITY); if (argCase.myHasUpper != ThreeState.YES && argCase.myHasLower != ThreeState.YES) return; StringCase qualifierCase = fromExpression(qualifier, ANALYSIS_COMPLEXITY); PsiElement anchor = Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()); String methodName = anchor.getText(); String returnValue = switch (methodName) { case "indexOf", "lastIndexOf" -> "-1"; default -> "false"; }; String errorMessage; if (qualifierCase.myHasLower == ThreeState.NO && argCase.myHasLower == ThreeState.YES) { errorMessage = InspectionGadgetsBundle.message("inspection.case.mismatch.message.arg.is.lower", methodName, returnValue); } else if (qualifierCase.myHasUpper == ThreeState.NO && argCase.myHasUpper == ThreeState.YES) { errorMessage = InspectionGadgetsBundle.message("inspection.case.mismatch.message.arg.is.upper", methodName, returnValue); } else { return; } holder.registerProblem(anchor, errorMessage); }