--- jsr166/src/test/loops/CancelledLockLoops.java 2009/11/02 23:42:46 1.5 +++ jsr166/src/test/loops/CancelledLockLoops.java 2014/12/31 17:00:58 1.9 @@ -1,12 +1,12 @@ /* * 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.util.concurrent.*; import java.util.concurrent.locks.*; -import java.util.*; public final class CancelledLockLoops { static final Random rng = new Random(); @@ -51,7 +51,7 @@ public final class CancelledLockLoops { threads[i] = new Thread(this); for (int i = 0; i < threads.length; ++i) threads[i].start(); - Thread[] cancels = (Thread[]) (threads.clone()); + Thread[] cancels = threads.clone(); Collections.shuffle(Arrays.asList(cancels), rng); barrier.await(); Thread.sleep(TIMEOUT); @@ -64,7 +64,7 @@ public final class CancelledLockLoops { barrier.await(); if (print) { long time = timer.getTime(); - double secs = (double)(time) / 1000000000.0; + double secs = (double) time / 1000000000.0; System.out.println("\t " + secs + "s run time"); }