--- jsr166/src/test/loops/NavigableSetCheck.java 2011/03/15 19:47:05 1.8 +++ jsr166/src/test/loops/NavigableSetCheck.java 2015/01/15 18:34:19 1.12 @@ -7,8 +7,8 @@ * @test * @synopsis Times and checks basic set operations */ -import java.util.*; import java.io.*; +import java.util.*; public class NavigableSetCheck { @@ -25,7 +25,7 @@ public class NavigableSetCheck { } public static void main(String[] args) throws Exception { - Class setClass = null; + Class setClass = null; int numTests = 50; int size = 50000; @@ -37,7 +37,6 @@ public class NavigableSetCheck { } } - if (args.length > 1) numTests = Integer.parseInt(args[1]); @@ -46,7 +45,6 @@ public class NavigableSetCheck { System.out.println("Testing " + setClass.getName() + " trials: " + numTests + " size: " + size); - absentSize = 8; while (absentSize < size) absentSize <<= 1; absentMask = absentSize - 1; @@ -59,7 +57,6 @@ public class NavigableSetCheck { for (int i = 0; i < size; ++i) key[i] = new Integer(i * 2 + 1); - for (int rep = 0; rep < numTests; ++rep) { runTest(newSet(setClass), key); } @@ -68,7 +65,7 @@ public class NavigableSetCheck { } - static NavigableSet newSet(Class cl) { + static NavigableSet newSet(Class cl) { try { NavigableSet m = (NavigableSet) cl.newInstance(); return m; @@ -77,7 +74,6 @@ public class NavigableSetCheck { } } - static void runTest(NavigableSet s, Integer[] key) { shuffle(key); int size = key.length; @@ -171,7 +167,6 @@ public class NavigableSetCheck { reallyAssert(sum == expect); } - static void higherTest(NavigableSet s) { int sum = 0; int iters = s.size(); @@ -226,7 +221,6 @@ public class NavigableSetCheck { reallyAssert(sum == iters-1); } - static void ktest(NavigableSet s, int size, Integer[] key) { timer.start("Contains ", size); int sum = 0; @@ -237,7 +231,6 @@ public class NavigableSetCheck { reallyAssert(sum == size); } - static void ittest1(NavigableSet s, int size) { int sum = 0; timer.start("Iter Key ", size); @@ -268,7 +261,6 @@ public class NavigableSetCheck { rittest1(s, size); } - static void rtest(NavigableSet s, int size) { timer.start("Remove (iterator) ", size); for (Iterator it = s.iterator(); it.hasNext(); ) { @@ -278,8 +270,6 @@ public class NavigableSetCheck { timer.finish(); } - - static void dtest(NavigableSet s, int size, Integer[] key) { timer.start("Add (addAll) ", size * 2); NavigableSet s2 = null; @@ -329,8 +319,6 @@ public class NavigableSetCheck { reallyAssert(s2.isEmpty() && s.isEmpty()); } - - static void test(NavigableSet s, Integer[] key) { int size = key.length; @@ -391,7 +379,6 @@ public class NavigableSetCheck { startTime = System.currentTimeMillis(); } - String classify() { if (name.startsWith("Contains")) return "Contains "; @@ -447,7 +434,7 @@ public class NavigableSetCheck { 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];