[jdk17] RFR: JDK-8269150 Unicode \u005C not treated as an escaping backslash [v6]
Alex Buckley
alex.buckley at oracle.com
Thu Jul 22 22:12:33 UTC 2021
Recommend the grouping below. I changed only the order of tests, and
added the x.y comments; I did not change any inputs or outputs, which
all looked correct. (3.6 and 4.2 are the most interesting IMO.)
-----
/* 1.1 */ test("\\]", "\\]");
/* 1.2 */ test("\u005C\]", "\\]");
/* 1.3 */ test("\\u005C]", "\\u005C]");
/* 1.4 */ test("\u005C\u005C]", "\\]");
/* 2.1 */ test("\\\\]", "\\\\]");
/* 2.2 */ test("\u005C\\\]", "\\\\]");
/* 2.3 */ test("\\u005C\\]", "\\u005C\\]");
/* 2.4 */ test("\\\u005C\]", "\\\\]");
/* 2.5 */ test("\\\\u005C]", "\\\\u005C]");
/* 3.1 */ test("\u005C\u005C\\]", "\\\\]");
/* 3.2 */ test("\u005C\\u005C\]", "\\\\]");
/* 3.3 */ test("\u005C\\\u005C]", "\\\\u005C]");
/* 3.4 */ test("\\u005C\u005C\]", "\\u005C\\]");
/* 3.5 */ test("\\u005C\\u005C]", "\\u005C\\u005C]");
/* 3.6 */ test("\\\u005C\u005C]", "\\\\]");
/* 4.1 */ test("\u005C\u005C\u005C\]", "\\\\]");
/* 4.2 */ test("\u005C\\u005C\u005C]", "\\\\]");
/* 4.3 */ test("\u005C\u005C\\u005C]", "\\\\u005C]");
/* 4.4 */ test("\\u005C\u005C\u005C]", "\\u005C\\]");
/* 5.1 */ test("\u005C\u005C\u005C\u005C]", "\\\\]");
-----
Alex
On 7/22/2021 11:41 AM, Alex Buckley wrote:
> I am not a Reviewer, but looking at the test UnicodeBackslash.java I
> recommend grouping the test case based on the number of \u005C Unicode
> escapes in the string literal, with a blank line between different
> groups. For example, swap lines 45 and 46, and have a blank line after
> 45 so that the tests with only one Unicode escape in four backslashes
> are together -- and have a comment to that effect. Without grouping and
> comments, this test is incomprehensible tomorrow.
>
> Alex
>
> On 7/22/2021 11:30 AM, Jan Lahoda wrote:
>> On Tue, 20 Jul 2021 13:35:24 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>>
>>>> \u005C Unicode escape sequence not being treated as a backslash for
>>>> general escape sequences.
>>>
>>> Jim Laskey has updated the pull request incrementally with one
>>> additional commit since the last revision:
>>>
>>> Remove comment duplicated by merge
>>
>> Looks good.
>>
>> -------------
>>
>> Marked as reviewed by jlahoda (Reviewer).
>>
>> PR: https://git.openjdk.java.net/jdk17/pull/126
>>
More information about the compiler-dev
mailing list