PsiReferenceExpression (PsiBinaryExpression expression) { final PsiExpression lhs = PsiUtil.skipParenthesizedExprDown(expression.getLOperand()); if (lhs == null) { return null; } final PsiExpression rhs = PsiUtil.skipParenthesizedExprDown(expression.getROperand()); if (rhs == null) { return null; } if (PsiTypes.nullType().equals(rhs.getType())) { if (!(lhs instanceof PsiReferenceExpression)) { return null; } return (PsiReferenceExpression)lhs; } if (PsiTypes.nullType().equals(lhs.getType())) { if (!(rhs instanceof PsiReferenceExpression)) { return null; } return (PsiReferenceExpression)rhs; } return null; }