RFR: 8369564: Provide a MemorySegment API to read strings with known lengths [v8]
Jorn Vernee
jvernee at openjdk.org
Fri Nov 21 12:59:54 UTC 2025
On Fri, 21 Nov 2025 10:38:40 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:
>> test/jdk/java/foreign/TestStringEncoding.java line 135:
>>
>>> 133: }
>>> 134: }
>>> 135:
>>
>> We need some more tests for the other new methods as well. Also, it would be nice to test non-standard charsets.
>
> I added more tests to cover regular and exception cases for the three new methods. I'm happy to take suggestions on additional test coverage, or if there's a better location for any of the tests.
Thanks, these look great!
I think another test that tests the case where `srcIndex + numChars` overflows for `copy` and `allocateFrom`, with different char sets (one that takes the internal `bytesCompatible == true`, and one that takes the `bytesCompatible == false` route) would be good to have.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28043#discussion_r2549679121
More information about the core-libs-dev
mailing list