String (PsiExpression expression, CommentTracker commentTracker) { final PsiExpression lhs; final PsiExpression rhs; final String operator; if (expression instanceof PsiAssignmentExpression) { final PsiAssignmentExpression exp = (PsiAssignmentExpression)expression; lhs = exp.getLExpression(); rhs = exp.getRExpression(); final IElementType tokenType = exp.getOperationTokenType(); if (tokenType.equals(JavaTokenType.ASTERISKEQ)) { operator = "<<="; } else { operator = ">>="; } } else { final PsiBinaryExpression exp = (PsiBinaryExpression)expression; lhs = exp.getLOperand(); rhs = exp.getROperand(); final IElementType tokenType = exp.getOperationTokenType(); if (tokenType.equals(JavaTokenType.ASTERISK)) { operator = "<<"; } else { operator = ">>"; } } if (!(rhs instanceof PsiLiteralExpression)) return null; final String lhsText = commentTracker.text(lhs, ParenthesesUtils.SHIFT_PRECEDENCE); String expString = lhsText + operator + ShiftUtils.getLogBaseTwo((PsiLiteralExpression)rhs); final PsiElement parent = expression.getParent(); if (parent instanceof PsiExpression) { if (!(parent instanceof PsiParenthesizedExpression) && ParenthesesUtils.getPrecedence((PsiExpression)parent) < ParenthesesUtils.SHIFT_PRECEDENCE) { expString = '(' + expString + ')'; } } return expString; }