RFR: 8284780: Need methods to create pre-sized HashSet and LinkedHashSet [v10]

liach duke at openjdk.java.net
Wed May 25 04:53:50 UTC 2022


On Tue, 24 May 2022 21:37:52 GMT, XenoAmess <duke at openjdk.java.net> wrote:

>> as title.
>
> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add test for newHashSet and newLinkedHashSet

test/jdk/java/util/HashMap/WhiteBoxResizeTest.java line 354:

> 352:                 rsc("rsls", size, cap, () -> {
> 353:                     try {
> 354:                         Field mapField = HashSet.class.getDeclaredField("map");

For clarity, consider using var handle/method handle and keep the reflection code in the `WhiteBoxResizeTest` constructor.

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

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


More information about the core-libs-dev mailing list