--- jsr166/src/test/loops/LoopHelpers.java 2009/10/29 23:09:07 1.7 +++ jsr166/src/test/loops/LoopHelpers.java 2011/12/05 04:08:46 1.12 @@ -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/ */ /** * Misc utilities in JSR166 performance tests @@ -53,7 +53,7 @@ class LoopHelpers { */ public static int compute3(int x) { int t = (x % 127773) * 16807 - (x / 127773) * 2836; - return (t > 0)? t : t + 0x7fffffff; + return (t > 0) ? t : t + 0x7fffffff; } /** @@ -106,9 +106,9 @@ class LoopHelpers { public static final class XorShift32Random { static final AtomicInteger seq = new AtomicInteger(8862213); int x = -1831433054; - public XorShift32Random(int seed) { x = seed; } + public XorShift32Random(int seed) { x = seed; } public XorShift32Random() { - this((int)System.nanoTime() + seq.getAndAdd(129)); + this((int) System.nanoTime() + seq.getAndAdd(129)); } public int next() { x ^= x << 6; @@ -128,7 +128,7 @@ class LoopHelpers { int w = 273326509; public MarsagliaRandom(int seed) { x = seed; } public MarsagliaRandom() { - this((int)System.nanoTime() + seq.getAndAdd(129)); + this((int) System.nanoTime() + seq.getAndAdd(129)); } public int next() { int t = x ^ (x << 11); @@ -143,9 +143,9 @@ class LoopHelpers { * Unsynchronized version of java.util.Random algorithm. */ public static final class SimpleRandom { - private final static long multiplier = 0x5DEECE66DL; - private final static long addend = 0xBL; - private final static long mask = (1L << 48) - 1; + private static final long multiplier = 0x5DEECE66DL; + private static final long addend = 0xBL; + private static final long mask = (1L << 48) - 1; static final AtomicLong seq = new AtomicLong( -715159705); private long seed; @@ -164,7 +164,7 @@ class LoopHelpers { public int next() { long nextseed = (seed * multiplier + addend) & mask; seed = nextseed; - return ((int)(nextseed >>> 17)) & 0x7FFFFFFF; + return ((int) (nextseed >>> 17)) & 0x7FFFFFFF; } }