RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v4]
XenoAmess
duke at openjdk.java.net
Thu May 26 18:24:38 UTC 2022
On Wed, 18 May 2022 23:20:45 GMT, Stuart Marks <smarks at openjdk.org> wrote:
>>> Need to add apiNote documentation section to capacity-based constructors like for maps.
>>
>> @liach done.
>
> @XenoAmess oops, sorry for the delay. I think it would be good to get these into 19 as companions to `HashMap.newHashMap` et. al.
>
> As before, I'd suggest reducing the number of changes to use sites in order to make review easier. I would suggest keeping the changes under src in java.base, java.net.http, java.rmi, and jdk.zipfs, and omitting all the other changes. Also keep the changes under test/jdk.
>
> There needs to be a test for these new methods. I haven't thought much how to do that. My first attempt would be to modify our favorite WhiteBoxResizeTest and add a bit of machinery that asserts the table length of the HashMap contained within the created HashSet/LinkedHashSet. I haven't looked at it though, so it might not work out, in which case you should pursue an alternative approach.
>
> I'll look at the specs and suggest updates as necessary and then handle filing of a CSR.
@stuart-marks @liach
Hi guys.
After a good sleep and a rethink, I re-wrote some part of the test.
It seems be logically better than the way before.
please have a look.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8302
More information about the core-libs-dev
mailing list