--- jsr166/src/test/loops/UnboundedQueueFillEmptyLoops.java 2009/10/29 23:09:08 1.3 +++ jsr166/src/test/loops/UnboundedQueueFillEmptyLoops.java 2014/12/18 18:43:22 1.9 @@ -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.*; @@ -16,11 +16,11 @@ public class UnboundedQueueFillEmptyLoop static Integer[] numbers; public static void main(String[] args) throws Exception { - Class klass = null; + Class klass = null; if (args.length > 0) { try { klass = Class.forName(args[0]); - } catch(ClassNotFoundException e) { + } catch (ClassNotFoundException e) { throw new RuntimeException("Class " + args[0] + " not found."); } } @@ -42,10 +42,10 @@ public class UnboundedQueueFillEmptyLoop oneRun(klass, maxSize); if (total == 0) System.out.print(" "); - } + } - static void oneRun(Class klass, int n) throws Exception { - Queue q = (Queue)klass.newInstance(); + static void oneRun(Class klass, int n) throws Exception { + Queue q = (Queue) klass.newInstance(); int sum = total; int m = rng.nextInt(numbers.length); long startTime = System.nanoTime(); @@ -62,7 +62,7 @@ public class UnboundedQueueFillEmptyLoop total += sum; long endTime = System.nanoTime(); long time = endTime - startTime; - double secs = (double)(time) / 1000000000.0; + double secs = (double) time / 1000000000.0; System.out.println("Time: " + secs); }