mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +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) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
|
@ -69,7 +69,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
|||
* Constructs a new, empty Attributes object with default size.
|
||||
*/
|
||||
public Attributes() {
|
||||
this(11);
|
||||
this(16);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
|
|||
* @param size the initial number of attributes
|
||||
*/
|
||||
public Attributes(int size) {
|
||||
map = new LinkedHashMap<>(size);
|
||||
map = LinkedHashMap.newLinkedHashMap(size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -672,7 +672,7 @@ class JarVerifier {
|
|||
* only about the asserted signatures. Verification of
|
||||
* signature validity happens via the JarEntry apis.
|
||||
*/
|
||||
signerMap = new HashMap<>(verifiedSigners.size() + sigFileSigners.size());
|
||||
signerMap = HashMap.newHashMap(verifiedSigners.size() + sigFileSigners.size());
|
||||
signerMap.putAll(verifiedSigners);
|
||||
signerMap.putAll(sigFileSigners);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue