--- jsr166/src/test/loops/MapWordLoops.java 2009/11/02 23:42:46 1.6 +++ jsr166/src/test/loops/MapWordLoops.java 2014/12/31 17:00:58 1.10 @@ -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 MapWordLoops { @@ -25,7 +25,7 @@ public class MapWordLoops { static final int numTests = 3; public static void main(String[] args) { - Class mapClass = null; + Class mapClass = null; try { mapClass = Class.forName(args[0]); } catch (ClassNotFoundException e) { @@ -42,7 +42,7 @@ public class MapWordLoops { } - static void tests(Class mapClass, int numTests, int sizeIndex) { + static void tests(Class mapClass, int numTests, int sizeIndex) { try { String[] key = readWords(sizeIndex); int size = key.length; @@ -66,7 +66,7 @@ public class MapWordLoops { } - static Map newMap(Class cl) { + static Map newMap(Class cl) { try { Map m = (Map)cl.newInstance(); return m; @@ -116,7 +116,7 @@ public class MapWordLoops { 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); @@ -177,7 +177,7 @@ public class MapWordLoops { if (r < pctrem) { map.remove(k); ++nremoves; - j += ((r >>> 8) & 7) + n / 2; + j += ((r >>> 8) & 7) + n / 2; if (j >= n) j -= n; } }