mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8186958: Need method to create pre-sized HashMap
Reviewed-by: chegar, naoto, joehw, lancea, wetmore, smarks
This commit is contained in:
parent
41fc078323
commit
87faa85c59
30 changed files with 208 additions and 73 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -193,7 +193,7 @@ public abstract class ListResourceBundle extends ResourceBundle {
|
|||
return;
|
||||
|
||||
Object[][] contents = getContents();
|
||||
HashMap<String,Object> temp = new HashMap<>(contents.length);
|
||||
HashMap<String,Object> temp = HashMap.newHashMap(contents.length);
|
||||
for (Object[] content : contents) {
|
||||
// key must be non-null String, value must be non-null
|
||||
String key = (String) content[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue