RFR: 8345292: Improve javadocs for MemorySegment::getStrings defining word boundary cases [v2]

Per Minborg pminborg at openjdk.org
Tue Jun 10 17:01:25 UTC 2025


On Tue, 10 Jun 2025 15:50:08 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update after comments
>
> src/java.base/share/classes/java/lang/foreign/MemorySegment.java line 1302:
> 
>> 1300:      * If the {@linkplain #byteSize()} of this segment is not evenly dividable by the
>> 1301:      * number of octets used by provided {@code charset}, the reminding bytes of this
>> 1302:      * segment is not accessed. For multi-octet charset, nulls are only detected on
> 
> Elsewhere in the javadoc we say string terminator/terminator char. The mention of `null` is surprising here.

The docs start with saying "Reads a null-terminated string..." so I thought this was not that surprising. But I will update the wording.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25715#discussion_r2138372991


More information about the core-libs-dev mailing list