boolean (PsiMethodCallExpression methodCallExpression) { final PsiReferenceExpression methodExpression = methodCallExpression.getMethodExpression(); PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(methodExpression.getQualifierExpression()); while (qualifier instanceof PsiMethodCallExpression call) { qualifier = PsiUtil.skipParenthesizedExprDown(call.getMethodExpression().getQualifierExpression()); } if (!(qualifier instanceof PsiReferenceExpression referenceExpression)) { return false; } final PsiElement target = referenceExpression.resolve(); if (!myVariable.equals(target)) { return false; } final PsiMethod method = methodCallExpression.resolveMethod(); if (method == null) { return false; } final PsiClass aClass = method.getContainingClass(); if (aClass == null) { return false; } final String name1 = aClass.getQualifiedName(); return CommonClassNames.JAVA_LANG_STRING_BUFFER.equals(name1) || CommonClassNames.JAVA_LANG_STRING_BUILDER.equals(name1); }