34 |
|
import java.util.function.BiFunction; |
35 |
|
import java.util.function.Consumer; |
36 |
|
import java.util.function.Function; |
37 |
< |
import jdk.internal.misc.SharedSecrets; |
37 |
> |
// OPENJDK import jdk.internal.access.SharedSecrets; |
38 |
|
|
39 |
|
/** |
40 |
|
* Hash table based implementation of the {@code Map} interface. This |
501 |
|
(int)ft : MAXIMUM_CAPACITY); |
502 |
|
if (t > threshold) |
503 |
|
threshold = tableSizeFor(t); |
504 |
+ |
} else { |
505 |
+ |
// Because of linked-list bucket constraints, we cannot |
506 |
+ |
// expand all at once, but can reduce total resize |
507 |
+ |
// effort by repeated doubling now vs later |
508 |
+ |
while (s > threshold && table.length < MAXIMUM_CAPACITY) |
509 |
+ |
resize(); |
510 |
|
} |
511 |
< |
else if (s > threshold) |
506 |
< |
resize(); |
511 |
> |
|
512 |
|
for (Map.Entry<? extends K, ? extends V> e : m.entrySet()) { |
513 |
|
K key = e.getKey(); |
514 |
|
V value = e.getValue(); |
1449 |
|
|
1450 |
|
// Check Map.Entry[].class since it's the nearest public type to |
1451 |
|
// what we're actually creating. |
1452 |
< |
SharedSecrets.getJavaObjectInputStreamAccess().checkArray(s, Map.Entry[].class, cap); |
1452 |
> |
jsr166.Platform.checkArray(s, Map.Entry[].class, cap); |
1453 |
|
@SuppressWarnings({"rawtypes","unchecked"}) |
1454 |
|
Node<K,V>[] tab = (Node<K,V>[])new Node[cap]; |
1455 |
|
table = tab; |