RFR: 8324573: HashMap::putAll should resize to sum of both map sizes [v3]
Joshua Cao
duke at openjdk.org
Sat Jan 27 22:00:26 UTC 2024
On Sat, 27 Jan 2024 09:09:26 GMT, Ismael Juma <duke at openjdk.org> wrote:
>> Joshua Cao has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Use max of both sizes and other maps size in case of overflow
>
> src/java.base/share/classes/java/util/HashMap.java line 503:
>
>> 501: */
>> 502: final void putMapEntries(Map<? extends K, ? extends V> m, boolean evict) {
>> 503: int s = Math.max(size() + m.size(), m.size());
>
> If we decide this approach is best, shouldn't we do the same for ConcurrentHashMap?
Sure. Created https://bugs.openjdk.org/browse/JDK-8324798. Won't implement that until this gets merged.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17544#discussion_r1468663381
More information about the core-libs-dev
mailing list