--- jsr166/src/test/loops/MapWordLoops.java 2009/10/29 23:09:07 1.5 +++ jsr166/src/test/loops/MapWordLoops.java 2011/12/05 04:08:46 1.8 @@ -1,7 +1,7 @@ /* * 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.*; @@ -28,7 +28,7 @@ public class MapWordLoops { Class mapClass = null; try { mapClass = Class.forName(args[0]); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { throw new RuntimeException("Class " + args[0] + " not found."); } @@ -70,13 +70,14 @@ public class MapWordLoops { try { Map m = (Map)cl.newInstance(); return m; - } catch(Exception e) { + } catch (Exception e) { throw new RuntimeException("Can't instantiate " + cl + ": " + e); } } static void pause() { - try { Thread.sleep(100); } catch(InterruptedException ie) { return; } + try { Thread.sleep(100); } + catch (InterruptedException ie) { return; } } static String[] readWords(int sizeIndex) throws IOException { @@ -115,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); @@ -176,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; } }