On Fri, 21 Nov 2025 14:26:34 GMT, Maurizio Cimadamore <[email protected]> 
wrote:

>> We do not, thanks, fixed.
>> 
>> Although I think the existing `allocateFrom(String, Charset)` method does 
>> have an undocumented dependency, because it uses `CharsetKind` to get the 
>> terminator char length, which only supports standard Charsets. If we add a 
>> fast path for UTF-16 that may need a dependency on a standard Charset (or a 
>> standard way to get the code unit size of a charset, if it has one).
>
> Note sure I follow -- the method you mention says this:
> 
>     * @throws IllegalArgumentException if {@code charset} is not a
>      *         {@linkplain StandardCharsets standard charset}
> 
> 
> What do you mean by "undocumented dependency"?

Sorry, you're right, it is documented. It's documented differently than e.g. 
`MemorySegment#getString`, which mentions it in both the `@param` and `@throws` 
doc.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28043#discussion_r2549946334

Reply via email to