-
Bug
-
Resolution: Fixed
-
P5
-
12
-
b08
-
Verified
This issue was brought up during review of the fix for JDK-8207314:
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-July/054403.html
---- by Martin ----
HashMap's resize() doesn't take an arg, while WeakHashMap's does. Why?
As a result, I see in HashMap.putMapEntries
else if (s > threshold)
resize();
which suggests that if you create a fresh HashMap, then putAll(hugeMap) it
will repeatedly resize instead of resizing to the target capacity in one
step. Which seems like a HashMap bug.
http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-July/054403.html
---- by Martin ----
HashMap's resize() doesn't take an arg, while WeakHashMap's does. Why?
As a result, I see in HashMap.putMapEntries
else if (s > threshold)
resize();
which suggests that if you create a fresh HashMap, then putAll(hugeMap) it
will repeatedly resize instead of resizing to the target capacity in one
step. Which seems like a HashMap bug.
- relates to
-
JDK-8324573 HashMap::putAll add notes for conservative resizing
- Open