--- jsr166/src/jsr166y/Phaser.java 2010/12/01 17:20:41 1.65 +++ jsr166/src/jsr166y/Phaser.java 2010/12/03 21:29:34 1.67 @@ -273,12 +273,12 @@ public class Phaser { private static int unarrivedOf(long s) { int counts = (int)s; - return (counts == EMPTY)? 0 : counts & UNARRIVED_MASK; + return (counts == EMPTY) ? 0 : counts & UNARRIVED_MASK; } private static int partiesOf(long s) { int counts = (int)s; - return (counts == EMPTY)? 0 : counts >>> PARTIES_SHIFT; + return (counts == EMPTY) ? 0 : counts >>> PARTIES_SHIFT; } private static int phaseOf(long s) { @@ -287,7 +287,7 @@ public class Phaser { private static int arrivedOf(long s) { int counts = (int)s; - return (counts == EMPTY)? 0 : + return (counts == EMPTY) ? 0 : (counts >>> PARTIES_SHIFT) - (counts & UNARRIVED_MASK); } @@ -411,7 +411,7 @@ public class Phaser { break; } else { - synchronized(this) { // 1st sub registration + synchronized (this) { // 1st sub registration if (state == s) { // recheck under lock par.doRegister(1); do { // force current phase @@ -524,7 +524,7 @@ public class Phaser { this.evenQ = new AtomicReference(); this.oddQ = new AtomicReference(); } - this.state = (parties == 0)? ((long) EMPTY) : + this.state = (parties == 0) ? ((long) EMPTY) : ((((long) phase) << PHASE_SHIFT) | (((long) parties) << PARTIES_SHIFT) | ((long) parties)); @@ -549,7 +549,7 @@ public class Phaser { * Adds the given number of new unarrived parties to this phaser. * If an ongoing invocation of {@link #onAdvance} is in progress, * this method may await its completion before returning. If this - * phaser has a parent, and the given number of parities is + * phaser has a parent, and the given number of parties is * greater than zero, and this phaser previously had no registered * parties, this phaser is also registered with its parent. *