boolean (PsiExpression expression) { final PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent()); if (parent == null) { return false; } if (!(parent instanceof PsiExpressionList)) { return false; } final PsiElement grandparent = parent.getParent(); if (!(grandparent instanceof PsiMethodCallExpression call)) { return false; } final PsiReferenceExpression methodExpression = call.getMethodExpression(); @NonNls final String name = methodExpression.getReferenceName(); if (!HardcodedMethodConstants.INDEX_OF.equals(name) && !HardcodedMethodConstants.LAST_INDEX_OF.equals(name)) { return false; } final PsiMethod method = call.resolveMethod(); if (method == null) { return false; } final PsiClass methodClass = method.getContainingClass(); if (methodClass == null) { return false; } final String className = methodClass.getQualifiedName(); return CommonClassNames.JAVA_LANG_STRING.equals(className); }