--- jsr166/src/test/loops/IntMapCheck.java 2010/09/01 07:47:27 1.9 +++ jsr166/src/test/loops/IntMapCheck.java 2015/01/15 18:34:19 1.14 @@ -1,14 +1,14 @@ /* * Written by Doug Lea with assistance from members of JCP JSR-166 * Expert Group and released to the public domain, as explained at - * http://creativecommons.org/licenses/publicdomain + * http://creativecommons.org/publicdomain/zero/1.0/ */ /** * @test * @synopsis Times and checks basic map operations */ -import java.util.*; import java.io.*; +import java.util.*; public class IntMapCheck { static int absentSize; @@ -22,7 +22,7 @@ public class IntMapCheck { } public static void main(String[] args) throws Exception { - Class mapClass = java.util.concurrent.ConcurrentHashMap.class; + Class mapClass = java.util.concurrent.ConcurrentHashMap.class; int numTests = 50; int size = 75000; @@ -34,7 +34,6 @@ public class IntMapCheck { } } - if (args.length > 1) numTests = Integer.parseInt(args[1]); @@ -68,12 +67,11 @@ public class IntMapCheck { TestTimer.printStats(); - if (doSerializeTest) stest(newMap(mapClass), size); } - static Map newMap(Class cl) { + static Map newMap(Class cl) { try { Map m = (Map)cl.newInstance(); return m; @@ -82,7 +80,6 @@ public class IntMapCheck { } } - static void runTest(Map s, Integer[] key) { int size = key.length; long startTime = System.nanoTime(); @@ -115,7 +112,6 @@ public class IntMapCheck { reallyAssert(sum == expect * iters); } - static void t2(String nm, int n, Map s, Integer[] key, int expect) { int sum = 0; timer.start(nm, n); @@ -190,7 +186,6 @@ public class IntMapCheck { reallyAssert(sum == expect); } - static void t9(Map s) { int sum = 0; int iters = 20; @@ -202,7 +197,6 @@ public class IntMapCheck { reallyAssert(sum != 0); } - static void ktest(Map s, int size, Integer[] key) { timer.start("ContainsKey ", size); Set ks = s.keySet(); @@ -214,7 +208,6 @@ public class IntMapCheck { reallyAssert(sum == size); } - static void ittest1(Map s, int size) { int sum = 0; timer.start("Iter Key ", size); @@ -286,7 +279,6 @@ public class IntMapCheck { reallyAssert(s.size() == size); } - static void ittest(Map s, int size) { for (int i = 0; i < 4; ++i) { ittest1(s, size); @@ -320,7 +312,6 @@ public class IntMapCheck { reallyAssert(sum == size); } - static void entest3(Hashtable ht, int size) { int sum = 0; @@ -399,7 +390,6 @@ public class IntMapCheck { reallyAssert(s.equals(m)); } - static void test(Map s, Integer[] key) { int size = key.length; @@ -551,7 +541,6 @@ public class IntMapCheck { startTime = System.nanoTime(); } - String classify() { if (name.startsWith("Get")) return "Get "; @@ -607,7 +596,7 @@ public class IntMapCheck { static void shuffle(Integer[] keys) { int size = keys.length; - for (int i=size; i>1; i--) { + for (int i = size; i > 1; i--) { int r = rng.nextInt(i); Integer t = keys[i-1]; keys[i-1] = keys[r];