Object () { final IElementType type = getLiteralElementType(); if (type == JavaTokenType.TRUE_KEYWORD) { return Boolean.TRUE; } if (type == JavaTokenType.FALSE_KEYWORD) { return Boolean.FALSE; } if (type == JavaTokenType.STRING_LITERAL) { return internedParseStringCharacters(PsiLiteralUtil.getStringLiteralContent(this)); } if (type == JavaTokenType.TEXT_BLOCK_LITERAL) { return internedParseStringCharacters(PsiLiteralUtil.getTextBlockText(this)); } String text = NUMERIC_LITERALS.contains(type) ? StringUtil.toLowerCase(getCanonicalText()) : getCanonicalText(); final int textLength = text.length(); if (type == JavaTokenType.INTEGER_LITERAL) { return PsiLiteralUtil.parseInteger(text); } if (type == JavaTokenType.LONG_LITERAL) { return PsiLiteralUtil.parseLong(text); } if (type == JavaTokenType.FLOAT_LITERAL) { return PsiLiteralUtil.parseFloat(text); } if (type == JavaTokenType.DOUBLE_LITERAL) { return PsiLiteralUtil.parseDouble(text); } if (type == JavaTokenType.CHARACTER_LITERAL) { if (textLength == 1 || !StringUtil.endsWithChar(text, '\'')) { return null; } text = text.substring(1, textLength - 1); CharSequence chars = CodeInsightUtilCore.parseStringCharacters(text, null); if (chars == null) return null; if (chars.length() != 1) return null; return chars.charAt(0); } return null; }