void (@NotNull PsiLiteralExpression expression) { super.visitLiteralExpression(expression); final PsiType type = expression.getType(); if (type == null) { return; } HighlightInfo.Builder parsingError = HighlightUtil.checkLiteralExpressionParsingError(expression, PsiUtil.getLanguageLevel(expression), null, null); if (parsingError != null) { return; } if (type.equalsToText(CommonClassNames.JAVA_LANG_STRING)) { final String text = expression.getText(); if (expression.isTextBlock()) { int end = text.length() - 3; int start = findUnnecessaryTextBlockEscapes(text, 4, end); while (start >= 0) { registerErrorAtOffset(expression, start, 2, text); start = findUnnecessaryTextBlockEscapes(text, start + 2, end); } } else { int start = findUnnecessaryStringEscapes(text, 1); while (start >= 0) { registerErrorAtOffset(expression, start, 2, text); start = findUnnecessaryStringEscapes(text, start + 2); } } } else if (reportChars && PsiTypes.charType().equals(type)) { final String text = expression.getText(); if ("'\\\"'".equals(text)) { registerErrorAtOffset(expression, 1, 2, text); } } }