RFR: 8281631: HashMap copy constructor and putAll can over-allocate table [v25]

XenoAmess duke at openjdk.java.net
Mon Mar 7 00:59:22 UTC 2022


On Fri, 4 Mar 2022 21:02:50 GMT, Stuart Marks <smarks at openjdk.org> wrote:

>>> This actually tests three things: 1) table is lazily allocated, 2) default capacity is 16, and 3) using putAll to populate the map with 64 elements results in a table size of 128. This should really be broken into three separate test methods. Once they're separated, the lazy allocation test should only called for HashMap and LinkedHashMap but not WeakHashMap.
>> 
>> @stuart-marks would you mind if I break WhiteBoxResizeTest class into several smaller Test classes, each focus on one of the test points you said?
>> If we split it into several tests, it would be more clear than sqruash into one test class, and we can make it parameterilized tests.
>
>> would you mind if I break WhiteBoxResizeTest class into several smaller Test classes, each focus on one of the test points you said?
> 
> Well, separate classes wouldn't be the approach that I'd take myself. However, I'm interested in you continuing to make progress on this, so if you'd prefer separate classes, then go ahead. However, I reserve the right to propose refactorings that merge things back into a single class. :-)

@stuart-marks done. please find some time for review. thanks.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7431


More information about the core-libs-dev mailing list