Java: improve error message "Illegal line end in string literal" (IDEA-331039)

GitOrigin-RevId: 625c9bb1f7e379283bd6c64f58a688560654293d
This commit is contained in:
Bas Leijdekkers
2023-08-29 23:28:30 +00:00
committed by intellij-monorepo-bot
parent 0fbb531c2f
commit c74b4f670e
4 changed files with 7 additions and 7 deletions
@@ -352,7 +352,7 @@ malformed.floating.point.literal=Malformed floating point literal
illegal.escape.character.in.character.literal=Illegal escape character in character literal
too.many.characters.in.character.literal=Too many characters in character literal
empty.character.literal=Empty character literal
illegal.line.end.in.string.literal=Illegal line end in string literal
illegal.line.end.in.string.literal=Line end not allowed in string literals
unclosed.char.literal=Unclosed character literal
illegal.escape.character.in.string.literal=Illegal escape character in string literal
illegal.unicode.escape=Illegal Unicode escape sequence
@@ -48,22 +48,22 @@ public class a {
String perverts2 = "<error descr="Illegal Unicode escape sequence">\uuuuuuuuuuuu123</error>";
char perv2 = '\uu3264';
String backSlash1 = <error descr="Illegal line end in string literal">"\u005c";</error>
String backSlash1 = <error descr="Line end not allowed in string literals">"\u005c";</error>
String backSlash2 = "\u005c\";
String backSlash3 = "\\u005c";
String backSlash4 = "\u005c\u005c";
String backSlash5 = "\u005c134";
String backSlash6 = <error descr="Illegal line end in string literal">"\134\u005c";</error>
String backSlash6 = <error descr="Line end not allowed in string literals">"\134\u005c";</error>
String backSlash7 = "\u005c\134";
String backSlash8 = "\u005c\u0022";
char backSlash9 = '\u005c\u0027';
void foo(String a) {
foo(<error descr="Illegal line end in string literal">"aaa</error>
foo(<error descr="Line end not allowed in string literals">"aaa</error>
);
}
String[] s = {
<error descr="Illegal line end in string literal">"unclosed</error>
<error descr="Line end not allowed in string literals">"unclosed</error>
};
}
@@ -48,7 +48,7 @@ class X {
System.out.println(STR. """
b<error descr="Illegal escape character in string literal">\a</error>d \{} esc<error descr="Illegal escape character in string literal">\a</error>pe 2
""");
System.out.println(STR."\{<error descr="Illegal line end in string literal">}unclosed);</error>
System.out.println(STR."\{<error descr="Line end not allowed in string literals">}unclosed);</error>
return STR."\{} <error descr="Illegal Unicode escape sequence">\u</error>X";
}
@@ -22,7 +22,7 @@ public class ConstantOnRHS
class C {
void t() {
<error descr="Cannot resolve method 'method' in 'C'">method</error>(String.format("", <error descr="Expression expected">StringBuffer</error>)<error descr="',' or ')' expected">"</error>" +<EOLError descr="Expression expected"></EOLError>
<<error descr="',' or ')' expected"><error descr="Expression expected">/</error></error><error descr="Cannot resolve symbol 'plugin'">plugin</error>><error descr="Illegal line end in string literal">" +</error>
<<error descr="',' or ')' expected"><error descr="Expression expected">/</error></error><error descr="Cannot resolve symbol 'plugin'">plugin</error>><error descr="Line end not allowed in string literals">" +</error>
<error descr="Not a statement">""</error><error descr="Unexpected token">)</error>;
}
}