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

Martin Buchholz martinrb at google.com
Thu Aug 22 15:33:16 UTC 2013


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.  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