7 |
|
* @test |
8 |
|
* @synopsis Times and checks basic map operations |
9 |
|
*/ |
10 |
– |
import java.util.*; |
10 |
|
import java.io.*; |
11 |
+ |
import java.util.*; |
12 |
|
|
13 |
|
public class IntMapCheck { |
14 |
|
static int absentSize; |
22 |
|
} |
23 |
|
|
24 |
|
public static void main(String[] args) throws Exception { |
25 |
< |
Class mapClass = java.util.concurrent.ConcurrentHashMap.class; |
25 |
> |
Class<?> mapClass = java.util.concurrent.ConcurrentHashMap.class; |
26 |
|
int numTests = 50; |
27 |
|
int size = 75000; |
28 |
|
|
73 |
|
stest(newMap(mapClass), size); |
74 |
|
} |
75 |
|
|
76 |
< |
static Map<Integer,Integer> newMap(Class cl) { |
76 |
> |
static Map<Integer,Integer> newMap(Class<?> cl) { |
77 |
|
try { |
78 |
|
Map m = (Map<Integer,Integer>)cl.newInstance(); |
79 |
|
return m; |
607 |
|
|
608 |
|
static void shuffle(Integer[] keys) { |
609 |
|
int size = keys.length; |
610 |
< |
for (int i=size; i>1; i--) { |
610 |
> |
for (int i = size; i > 1; i--) { |
611 |
|
int r = rng.nextInt(i); |
612 |
|
Integer t = keys[i-1]; |
613 |
|
keys[i-1] = keys[r]; |