RFR: 8302818: Optimize wrapper sets and immutable sets of Enums
Tingjun Yuan
duke at openjdk.org
Mon Feb 20 12:15:34 UTC 2023
On Thu, 9 Feb 2023 16:20:31 GMT, Tingjun Yuan <duke at openjdk.org> wrote:
> Currently, the two subclasses of `java.util.EnumSet` optimize bulk operations when the argument is also a `EnumSet`, but there is no such optimization for wrapper sets (returned by `Collections.unmodifiableSet`, `Collections.synchronizedSet`, etc.) and immutable sets (returned by `Set.of` methods) of `Enum`s.
>
> This PR introduces optimization classes for these situations. No public APIs are changed.
Oops, my bad. Please ignore the merge warning.
I've just add several tests for `Set.of` factories.
By the way, I've just built the JDK successfully on my Mac, and the tests run successfully too. Let me know if it fails on other operating systems.
-------------
PR: https://git.openjdk.org/jdk/pull/12498
More information about the core-libs-dev
mailing list