On Thu, 20 Nov 2025 15:47:18 GMT, Jorn Vernee <[email protected]> wrote:
>> Liam Miller-Cushon has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Review feedback
>
> src/java.base/share/classes/jdk/internal/foreign/StringSupport.java line 68:
>
>> 66: @ForceInline
>> 67: public static String readBytes(AbstractMemorySegmentImpl segment,
>> long offset, Charset charset, long length) {
>> 68: final int lengthBytes = (int) length;
>
> I think we should do something more here than just ignore the upper bits. We
> probably need to throw an exception when the value is > Integer.MAX_VALUE
Looks like we are already specified to throw IAE if 'the size of the string is
greater than the largest string supported by the platform'
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28043#discussion_r2546639764