RFR 8023463 Update HashMap and LinkedHashMap to use bins/buckets or trees (red/black)

Paul Sandoz paul.sandoz at oracle.com
Sun Aug 25 09:32:24 UTC 2013

On Aug 22, 2013, at 5:33 PM, Martin Buchholz <martinrb at google.com> wrote:

> I support the treeification of all the HashMaps.
> On Wed, Aug 21, 2013 at 5:25 AM, Paul Sandoz <paul.sandoz at oracle.com> wrote:
> I recommend when this code goes in we look closely at code coverage results to see if we are missing areas testing tree functionality and update/add new tests accordingly.
> Testing is indeed a problem. Treeification is only triggered when hash codes collide AND there are sufficient elements in the map.

Yes, i concocted a mechanism to test treeifying and untreeifying. It's tricky to verify it occurs without some more invasive approach such as probing method calls, plus it's very dependent on the internal constants but i don't see how else it can be.


>  All existing tests for hash collections could be examined to check whether they can be adapted to additionally test such maps.  But that would be a lot of work.
> See test classes containing
>         public int hashCode() { return 42; }
> in
> http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/tck/ConcurrentHashMapTest.java?view=co

More information about the core-libs-dev mailing list