void (@NotNull PsiReferenceExpression expression) { super.visitReferenceExpression(expression); if (expression.getQualifierExpression() != null) { return; } final PsiElement target = expression.resolve(); if (!myVariable.equals(target)) { return; } if (ExpressionUtils.isImplicitToStringCall(expression)) { myExpressions.add(expression); } else { PsiMethodCallExpression methodCallExpression = null; PsiElement parent = expression.getParent(); PsiElement grandParent = parent.getParent(); while (parent instanceof PsiReferenceExpression && grandParent instanceof PsiMethodCallExpression) { methodCallExpression = (PsiMethodCallExpression)grandParent; parent = methodCallExpression.getParent(); grandParent = parent.getParent(); if ("toString".equals(methodCallExpression.getMethodExpression().getReferenceName())) { break; } } myExpressions.add(methodCallExpression); } }