void (@NotNull PsiElement element, @NotNull ActionContext context, @NotNull ModPsiUpdater updater) { final GrLiteral exp = (GrLiteral)element; String textString = exp.getText().replaceAll("_", ""); final int textLength = textString.length(); final char lastChar = textString.charAt(textLength - 1); final boolean isLong = lastChar == 'l' || lastChar == 'L'; if (isLong) { textString = textString.substring(0, textLength - 1); } final BigInteger val; if (textString.startsWith("0b") || textString.startsWith("0B")) { val = new BigInteger(textString.substring(2), 2); } else if (textString.charAt(0) == '0') { val = new BigInteger(textString, 8); } else { val = new BigInteger(textString, 10); } @NonNls String hexString = "0x" + val.toString(16); if (isLong) { hexString += 'L'; } PsiImplUtil.replaceExpression(hexString, exp); }