On Fri, 4 Sep 2026 14:54:19 GMT, ExE Boss <[email protected]> wrote:

>> Definitely out of scope and probably obvious, but if there ever was 
>> something like `SequencedMap::of` / `SequencedMap::ofEntries` / 
>> `SequencedMap::copyOf`, `JsonObjectImpl` would be a prime candidate for the 
>> latter.
>
> Note that `List.copyOf(…)` should probably be improved to trust the return 
> value of `List::toArray()` when the list implementation’s class is exactly 
> `ArrayList.class`[^1][^2]:
> - https://github.com/openjdk/jdk/pull/32282#discussion_r3774849249
> 
> --------------------------------------------------------------------------------
> 
> Also, +1 to introducing `SequencedMap::of(…)` and `SequencedSet::of(…)`.
> 
> [^1]: And probably some other well‑known and trusted JDK list implementations.
> [^2]: The same should probably also be done with 
> [`MethodType​.methodType​(Class, List)`].
> 
> [`MethodType​.methodType​(Class, List)`]: 
> https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/invoke/MethodType.html#methodType(java.lang.Class,java.util.List)

Thanks for the suggestion. Since it would require access to `SharedSecrets`, 
we'll consider that level of performance improvement once the API is no longer 
incubating.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3936651995

Reply via email to