RFR: 8299444 java.util.Set.copyOf allocates needlessly for empty input collections

Sergey Bylokhov serb at openjdk.org
Thu Jan 5 01:04:48 UTC 2023


On Wed, 4 Jan 2023 19:39:23 GMT, Stuart Marks <smarks at openjdk.org> wrote:

> so it's difficult to write a simple functional test for this change.

It is possible to track that for some "custom" and empty collection the only method will be called is `isEmpty` and nothing else. Not sure how it is useful or not.

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

PR: https://git.openjdk.org/jdk/pull/11847


More information about the core-libs-dev mailing list