--- jsr166/src/test/loops/CollectionWordLoops.java 2009/11/02 23:51:32 1.5 +++ jsr166/src/test/loops/CollectionWordLoops.java 2014/12/31 17:00:58 1.9 @@ -1,10 +1,10 @@ /* * 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/ */ -import java.util.*; import java.io.*; +import java.util.*; public class CollectionWordLoops { @@ -23,7 +23,7 @@ public class CollectionWordLoops { static final int numTests = 2; public static void main(String[] args) { - Class collectionClass = null; + Class collectionClass = null; try { collectionClass = Class.forName(args[0]); } catch (ClassNotFoundException e) { @@ -40,7 +40,7 @@ public class CollectionWordLoops { } - static void tests(Class collectionClass, int numTests, int sizeIndex) { + static void tests(Class collectionClass, int numTests, int sizeIndex) { try { String[] key = readWords(sizeIndex); int size = key.length; @@ -64,7 +64,7 @@ public class CollectionWordLoops { } - static Collection newCollection(Class cl) { + static Collection newCollection(Class cl) { try { Collection m = (Collection) cl.newInstance(); return m; @@ -114,7 +114,7 @@ public class CollectionWordLoops { long startTime = System.currentTimeMillis(); runner.run(); long afterRun = System.currentTimeMillis(); - long runTime = (afterRun - startTime); + long runTime = afterRun - startTime; int np = runner.total; if (runner.total == runner.hashCode()) System.out.println("Useless Number" + runner.total); @@ -173,7 +173,7 @@ public class CollectionWordLoops { if (r < pctrem) { collection.remove(k); ++nremoves; - j += ((r >>> 8) & 7) + n / 2; + j += ((r >>> 8) & 7) + n / 2; if (j >= n) j -= n; } }