On Sat, 2 Apr 2022 22:46:19 GMT, XenoAmess <d...@openjdk.java.net> wrote:

>> 8186958: Need method to create pre-sized HashMap
>
> XenoAmess has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   revert changes in jdk.compile

src/java.base/share/classes/java/util/LinkedHashMap.java line 804:

> 802:      * @since 19
> 803:      */
> 804:     public static <K, V> LinkedHashMap<K, V> newLinkedHashMap(int 
> numMappings) {

`LinkedHashMap` may be often extended for it has a `protected boolean 
removeEldestEntry(Entry)`. Should we make a separate factory method for such 
instances (with functional implementation) or just expose 
`HashMap.calculateHashMapCapacity`?

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

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

Reply via email to