boolean (PsiExpression operand, PsiReferenceExpression ref) { PsiReferenceExpression other = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(operand), PsiReferenceExpression.class); if (other == null) { return false; } String name = other.getReferenceName(); if (name == null || !name.equals(ref.getReferenceName())) return false; PsiExpression qualifier = ref.getQualifierExpression(); PsiExpression otherQualifier = other.getQualifierExpression(); if (qualifier == null && otherQualifier == null) return true; if (qualifier == null && ref.resolve() instanceof PsiField) { qualifier = ExpressionUtils.getEffectiveQualifier(ref); } if (otherQualifier == null && other.resolve() instanceof PsiField) { otherQualifier = ExpressionUtils.getEffectiveQualifier(other); } if (qualifier == null || otherQualifier == null) return false; if (qualifier instanceof PsiReferenceExpression) { return isSameReference(otherQualifier, (PsiReferenceExpression)qualifier); } return PsiEquivalenceUtil.areElementsEquivalent(qualifier, otherQualifier); }