RFR: JDK-8170945: Collectors$Partition should override more Map methods [v2]

Viktor Klang duke at openjdk.org
Wed Apr 12 07:59:18 UTC 2023


On Wed, 12 Apr 2023 07:55:28 GMT, Viktor Klang <duke at openjdk.org> wrote:

>> Adds overrides for common Map operations to avoid having to allocate the entrySet for Collectors$Partition maps.
>
> Viktor Klang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Let auto-boxing do its thing for Collectors.get(key)

src/java.base/share/classes/java/util/stream/Collectors.java line 1988:

> 1986:         public T get(Object key) {
> 1987:             if (key instanceof Boolean b) {
> 1988:                 return b ? forTrue : forFalse;

@stuart-marks I've removed the `booleanValue()` here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13347#discussion_r1163760887


More information about the core-libs-dev mailing list