Integrated: 6323374: (coll) Optimize Collections.unmodifiable* and synchronized*

Ian Graves igraves at openjdk.java.net
Fri Mar 5 03:23:49 UTC 2021


On Tue, 16 Feb 2021 21:57:43 GMT, Ian Graves <igraves at openjdk.org> wrote:

> Modify the `unmodifiable*` methods in `java.util.Collections` to be idempotent. That is, when given an immutable collection from `java.util.ImmutableCollections` or `java.util.Collections`, these methods will return the reference instead of creating a new immutable collection that wraps the existing one.

This pull request has now been integrated.

Changeset: dbef0ec9
Author:    Ian Graves <igraves at openjdk.org>
Committer: Stuart Marks <smarks at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/dbef0ec9
Stats:     146 lines in 2 files changed: 145 ins; 0 del; 1 mod

6323374: (coll) Optimize Collections.unmodifiable* and synchronized*

Reviewed-by: redestad, smarks, darcy

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

PR: https://git.openjdk.java.net/jdk/pull/2596


More information about the core-libs-dev mailing list