void (@NotNull PsiLiteralExpression expression) { super.visitLiteralExpression(expression); final PsiType type = expression.getType(); if (type == null || !TypeUtils.isJavaLangString(type) && !type.equals(PsiTypes.charType())) { return; } final String text = expression.getText(); final int[] offsets = new int[text.length() + 1]; final CharSequence result = CodeInsightUtilCore.parseStringCharacters(text, offsets); if (result != null) { for (int i = 0, max = result.length(); i < max; i++) { final char c = result.charAt(i); if (c == '\n' || c == '\r') { final int offset = offsets[i]; final int length = offsets[i + 1] - offset; if (length > 1) { registerErrorAtOffset(expression, offset, length); } } } } }