--- jsr166/src/test/loops/Microscope.java 2011/03/15 19:47:05 1.6 +++ jsr166/src/test/loops/Microscope.java 2012/01/02 23:40:59 1.10 @@ -242,7 +242,7 @@ public class Microscope extends JPanel { if (lookAheads <= 1) lookAheads = 2; } - public int level () { return Microscope.lookAheads; } + public int level() { return Microscope.lookAheads; } // process a move (called only from mover) @@ -479,7 +479,7 @@ public class Microscope extends JPanel { * threads (instead new ones are constructed), so don't * need any synch. */ - static final class Board { + static final class Board { /* First, some Constants and utilities that might as well be here @@ -606,7 +606,7 @@ public class Microscope extends JPanel { // place a tile, taking all adjacent tiles of opponent public void take(Player player, int row, int col) { - int k = (row + col * RANKS); + int k = row + col * RANKS; long dest = 1L << k; long nbrMask = adjacentMasks[k]; long sourceBlue = blue_; @@ -617,7 +617,7 @@ public class Microscope extends JPanel { } else { blue_ = sourceBlue & ~(sourceBlue & nbrMask); - green_ = sourceGreen | dest | (sourceBlue & nbrMask); + green_ = sourceGreen | dest | (sourceBlue & nbrMask); } } @@ -751,9 +751,9 @@ public class Microscope extends JPanel { // setters: - synchronized void player(Player p) { player_ = p; } - synchronized void board(Board b) { board_ = b; } - synchronized void from(int sr, int sc) { fromRow = sr; fromCol = sc; } + synchronized void player(Player p) { player_ = p; } + synchronized void board(Board b) { board_ = b; } + synchronized void from(int sr, int sc) { fromRow = sr; fromCol = sc; } synchronized void to(int dr, int dc) { toRow = dr; toCol = dc; } // accessors: @@ -761,7 +761,7 @@ public class Microscope extends JPanel { synchronized boolean isFrom(int r, int c) { return fromRow== r && fromCol == c; } - synchronized boolean isTo(int r, int c) { + synchronized boolean isTo(int r, int c) { return toRow == r && toCol == c; } synchronized Board board() { @@ -1005,7 +1005,7 @@ public class Microscope extends JPanel { Finder forked = null; // list of forked subtasks when level > 1 long open = ~(ours | theirs); // currently empty cells - long here = 1; // travserse through bits + long here = 1; // traverse through bits for (int k = 0; k < Board.CELLS; ++k, here <<= 1) { if ((here & ours) != 0) {