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

2023-04-12 Thread Viktor Klang
> 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) -

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

2023-04-12 Thread Viktor Klang
On Wed, 12 Apr 2023 07:55:28 GMT, Viktor Klang 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: > > L

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-11 Thread Stuart Marks
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. OK, the change is probably good, including removal of the `booleanValue` call. I'm not sure `containsKey` and `containsValue

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-11 Thread Viktor Klang
On Tue, 11 Apr 2023 01:18:53 GMT, Stuart Marks wrote: >> Adds overrides for common Map operations to avoid having to allocate the >> entrySet for Collectors$Partition maps. > > I don't think there is any useful relationship between this work at > SequencedCollections / SequencedMap. The return

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-10 Thread Stuart Marks
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. I don't think there is any useful relationship between this work at SequencedCollections / SequencedMap. The return type of

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Viktor Klang
On Wed, 5 Apr 2023 12:49:31 GMT, Tagir F. Valeev wrote: >> Adds overrides for common Map operations to avoid having to allocate the >> entrySet for Collectors$Partition maps. > > Another thing I noticed is that `keySet()` of this map is a constant. If we > want to preserve the order, we can use

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Viktor Klang
On Wed, 5 Apr 2023 12:52:11 GMT, Andrey Turbanov wrote: >> Adds overrides for common Map operations to avoid having to allocate the >> entrySet for Collectors$Partition maps. > > src/java.base/share/classes/java/util/stream/Collectors.java line 1988: > >> 1986: public T get(Object key)

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Tagir F . Valeev
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. Another thing I noticed is that `keySet()` of this map is a constant. If we want to preserve the order, we can use something

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Andrey Turbanov
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. src/java.base/share/classes/java/util/stream/Collectors.java line 1988: > 1986: public T get(Object key) { > 1987:

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Tagir F . Valeev
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. Interesting improvement! How about `forEach` and `values`? These look quite easy to implement. @Override public vo

Re: RFR: JDK-8170945: Collectors$Partition should override more Map methods

2023-04-05 Thread Alan Bateman
On Wed, 5 Apr 2023 09:19:57 GMT, Viktor Klang wrote: > Adds overrides for common Map operations to avoid having to allocate the > entrySet for Collectors$Partition maps. src/java.base/share/classes/java/util/stream/Collectors.java line 1988: > 1986: public T get(Object key) { > 1987:

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

2023-04-05 Thread Viktor Klang
Adds overrides for common Map operations to avoid having to allocate the entrySet for Collectors$Partition maps. - Commit messages: - Overriding containsKey and containsValue of Collectors - JDK-8170945: override more Map-methods on Collectors Changes: https://git.openjdk.org/jdk/