RFR: : (coll) IdentityHashMap is resized before exceeding the expected maximum size
ivan.gerasimov at oracle.com
Thu Jul 3 16:00:22 UTC 2014
IdentityHasMap has a couple of small issues.
The first one is a performance issue: If you create a map, specifying 42
as the expected number of element, you'll be able to insert only 41
elements into the preallocated table. Inserting the 42th element will
trigger resizing of the storage.
Another issue is that resizing occurs only after the element insertion.
In the extreme case it can lead to the situation when the element is
successfully inserted and then en exception is thrown due the map been
unable to grow.
Would you please help review the fix?
More information about the core-libs-dev