mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -1655,7 +1655,7 @@ public class Thread implements Runnable {
|
|||
// Get a snapshot of the list of all threads
|
||||
Thread[] threads = getThreads();
|
||||
StackTraceElement[][] traces = dumpThreads(threads);
|
||||
Map<Thread, StackTraceElement[]> m = new HashMap<>(threads.length);
|
||||
Map<Thread, StackTraceElement[]> m = HashMap.newHashMap(threads.length);
|
||||
for (int i = 0; i < threads.length; i++) {
|
||||
StackTraceElement[] stackTrace = traces[i];
|
||||
if (stackTrace != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue