--- jsr166/src/jsr166e/ConcurrentHashMapV8.java 2013/06/19 14:55:40 1.102 +++ jsr166/src/jsr166e/ConcurrentHashMapV8.java 2013/06/19 17:11:57 1.106 @@ -228,7 +228,7 @@ public class ConcurrentHashMapV8 * java.util.Spliterator. */ public static interface ConcurrentHashMapSpliterator { - /** + /** * If possible, returns a new spliterator covering * approximately one half of the elements, which will not be * covered by this spliterator. Returns null if cannot be @@ -735,11 +735,11 @@ public class ConcurrentHashMapV8 Node c, Node v) { return U.compareAndSwapObject(tab, ((long)i << ASHIFT) + ABASE, c, v); } - + static final void setTabAt(Node[] tab, int i, Node v) { U.putOrderedObject(tab, ((long)i << ASHIFT) + ABASE, v); } - + /* ---------------- Fields -------------- */ /** @@ -2422,10 +2422,10 @@ public class ConcurrentHashMapV8 ++hc; } } - ln = (lc <= UNTREEIFY_THRESHOLD ? untreeify(lo) : - (hc != 0) ? new TreeBin(lo) : t); - hn = (hc <= UNTREEIFY_THRESHOLD ? untreeify(hi) : - (lc != 0) ? new TreeBin(hi) : t); + ln = (lc <= UNTREEIFY_THRESHOLD) ? untreeify(lo) : + (hc != 0) ? new TreeBin(lo) : t; + hn = (hc <= UNTREEIFY_THRESHOLD) ? untreeify(hi) : + (lc != 0) ? new TreeBin(hi) : t; } else ln = hn = null; @@ -2475,7 +2475,7 @@ public class ConcurrentHashMapV8 } /** - * Returns a list on non-TreeNodes replacing those in given list + * Returns a list on non-TreeNodes replacing those in given list. */ static Node untreeify(Node b) { Node hd = null, tl = null; @@ -2530,13 +2530,13 @@ public class ConcurrentHashMapV8 return p; else if (pl == null && pr == null) break; - else if ((kc != null || + else if ((kc != null || (kc = comparableClassFor(k)) != null) && (dir = compareComparables(kc, k, pk)) != 0) p = (dir < 0) ? pl : pr; else if (pl == null) p = pr; - else if (pr == null || + else if (pr == null || (q = pr.findTreeNode(h, k, kc)) == null) p = pl; else @@ -2613,7 +2613,7 @@ public class ConcurrentHashMapV8 } /** - * Acquires write lock for tree restructuring + * Acquires write lock for tree restructuring. */ private final void lockRoot() { if (!U.compareAndSwapInt(this, LOCKSTATE, 0, WRITER)) @@ -2621,14 +2621,14 @@ public class ConcurrentHashMapV8 } /** - * Releases write lock for tree restructuring + * Releases write lock for tree restructuring. */ private final void unlockRoot() { lockState = 0; } /** - * Possibly blocks awaiting root lock + * Possibly blocks awaiting root lock. */ private final void contendedLock() { boolean waiting = false; @@ -2751,7 +2751,7 @@ public class ConcurrentHashMapV8 * that are accessible independently of lock. So instead we * swap the tree linkages. * - * @return true if now too small so should be untreeified. + * @return true if now too small, so should be untreeified */ final boolean removeTreeNode(TreeNode p) { TreeNode next = (TreeNode)p.next; @@ -3034,6 +3034,7 @@ public class ConcurrentHashMapV8 } } } + /** * Recursive invariant check */ @@ -3145,7 +3146,7 @@ public class ConcurrentHashMapV8 /** * Base of key, value, and entry Iterators. Adds fields to - * Traverser to support iterator.remove + * Traverser to support iterator.remove. */ static class BaseIterator extends Traverser { final ConcurrentHashMapV8 map; @@ -5985,7 +5986,7 @@ public class ConcurrentHashMapV8 } /** - * Generates initial value for per-thread CounterHashCodes + * Generates initial value for per-thread CounterHashCodes. */ static final AtomicInteger counterHashCodeGenerator = new AtomicInteger();