On Mon, 10 Aug 2026 11:57:27 GMT, Volkan Yazici <[email protected]> wrote:

>> Liam Miller-Cushon has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   More bytesCompatible coverage, special case for empty strings
>
> test/jdk/java/foreign/TestStringEncoding.java line 790:
> 
>> 788:         return new Object[][] {
>> 789:             {
>> 790:                 List.of("", "hello world", "123"),
> 
> `""` would work for `nativeUtf16` too, no?

Done--updated the tests, and added a case to `bytesCompatible` to handle the 
empty string. (In practice the usage of the method is mostly used to avoid 
copies for non-empty strings.)

> test/jdk/java/foreign/TestStringEncoding.java line 805:
> 
>> 803:                         "cjk \u4E00\u4E8C",
>> 804:                         "rainbow \uD83C\uDF08",
>> 805:                         "\uD83D\uDE00"),
> 
> Can we extend this with a valid UTF-16 code unit above U+DFFF?

Done

> test/jdk/java/foreign/TestStringEncoding.java line 809:
> 
>> 807:             },
>> 808:             {
>> 809:                 List.of("unpaired surrogate \uD83C", "\uD83D", 
>> "\uDC00", "\uDC00\uD83C"), Set.of(),
> 
> I'd appreciate it if we can change this `strings` list such that
> 
> 1. Start all with a valid explanation: `"unpaired high surrogate: \uD83C", 
> ...`
> 2. Add `"high surrogate followed by a non-low surrogate: \uD83C\uE000"`
> 3. Add `"valid pair followed by an unpaired low surrogate: 
> \uD83D\uDE00\uDC00"`

Thanks, done

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/32268#discussion_r3750290618
PR Review Comment: https://git.openjdk.org/jdk/pull/32268#discussion_r3750298359
PR Review Comment: https://git.openjdk.org/jdk/pull/32268#discussion_r3750288097

Reply via email to