void (PsiElement element) { final PsiBinaryExpression exp = (PsiBinaryExpression)element; final PsiExpression lhs = exp.getLOperand(); final PsiExpression rhs = PsiUtil.skipParenthesizedExprDown(exp.getROperand()); final IElementType tokenType = exp.getOperationTokenType(); final String operatorString; if (tokenType.equals(JavaTokenType.LTLT)) { operatorString = "*"; } else { operatorString = "/"; } CommentTracker commentTracker = new CommentTracker(); final String lhsText = commentTracker.text(lhs, ParenthesesUtils.MULTIPLICATIVE_PRECEDENCE); String expString = lhsText + operatorString + ShiftUtils.getExpBase2(rhs); final PsiElement parent = exp.getParent(); if (parent instanceof PsiExpression) { if (!(parent instanceof PsiParenthesizedExpression) && ParenthesesUtils.getPrecedence((PsiExpression)parent) < ParenthesesUtils.MULTIPLICATIVE_PRECEDENCE) { expString = '(' + expString + ')'; } } PsiReplacementUtil.replaceExpression(exp, expString, commentTracker); }