--- jsr166/src/jsr166e/ConcurrentHashMapV8.java 2011/09/09 13:02:01 1.16 +++ jsr166/src/jsr166e/ConcurrentHashMapV8.java 2011/09/11 04:25:00 1.23 @@ -152,7 +152,7 @@ public class ConcurrentHashMapV8 * node of a bin list itself as a lock, using plain "synchronized" * locks. These save space and we can live with block-structured * lock/unlock operations. Using the first node of a list as a - * lock does not by itself suffice though: When a node is locked, + * lock does not by itself suffice though. When a node is locked, * any update must first validate that it is still the first node, * and retry if not. Because new nodes are always appended to * lists, once a node is first in a bin, it remains first until @@ -291,7 +291,7 @@ public class ConcurrentHashMapV8 * special, and do not contain user keys or values. Otherwise, * keys are never null, and null val fields indicate that a node * is in the process of being deleted or created. For purposes of - * read-only, access, a key may be read before a val, but can only + * read-only access, a key may be read before a val, but can only * be used after checking val. (For an update operation, when a * lock is held on a node, order doesn't matter.) */ @@ -422,7 +422,7 @@ public class ConcurrentHashMapV8 return table; } - /* + /** * Reclassifies nodes in each bin to new table. Because we are * using power-of-two expansion, the elements from each bin must * either stay at same index, or move with a power of two @@ -771,11 +771,11 @@ public class ConcurrentHashMapV8 * valid. * * Internal traversals directly access these fields, as in: - * {@code while (it.next != null) { process(nextKey); it.advance(); }} + * {@code while (it.next != null) { process(it.nextKey); it.advance(); }} * * Exported iterators (subclasses of ViewIterator) extract key, * value, or key-value pairs as return values of Iterator.next(), - * and encapulate the it.next check as hasNext(); + * and encapsulate the it.next check as hasNext(); * * The iterator visits each valid node that was reachable upon * iterator construction once. It might miss some that were added @@ -866,7 +866,7 @@ public class ConcurrentHashMapV8 * @param initialCapacity The implementation performs internal * sizing to accommodate this many elements. * @throws IllegalArgumentException if the initial capacity of - * elements is negative. + * elements is negative */ public ConcurrentHashMapV8(int initialCapacity) { if (initialCapacity < 0) @@ -898,7 +898,7 @@ public class ConcurrentHashMapV8 * performs internal sizing to accommodate this many elements, * given the specified load factor. * @param loadFactor the load factor (table density) for - * establishing the initial table size. + * establishing the initial table size * @throws IllegalArgumentException if the initial capacity of * elements is negative or the load factor is nonpositive * @@ -918,13 +918,13 @@ public class ConcurrentHashMapV8 * performs internal sizing to accommodate this many elements, * given the specified load factor. * @param loadFactor the load factor (table density) for - * establishing the initial table size. + * establishing the initial table size * @param concurrencyLevel the estimated number of concurrently * updating threads. The implementation may use this value as * a sizing hint. * @throws IllegalArgumentException if the initial capacity is * negative or the load factor or concurrencyLevel are - * nonpositive. + * nonpositive */ public ConcurrentHashMapV8(int initialCapacity, float loadFactor, int concurrencyLevel) { @@ -980,7 +980,7 @@ public class ConcurrentHashMapV8 * @param key possible key * @return {@code true} if and only if the specified object * is a key in this table, as determined by the - * {@code equals} method; {@code false} otherwise. + * {@code equals} method; {@code false} otherwise * @throws NullPointerException if the specified key is null */ public boolean containsKey(Object key) { @@ -1117,14 +1117,14 @@ public class ConcurrentHashMapV8 * @param mappingFunction the function to compute a value * @return the current (existing or computed) value associated with * the specified key, or {@code null} if the computation - * returned {@code null}. + * returned {@code null} * @throws NullPointerException if the specified key or mappingFunction - * is null, + * is null * @throws IllegalStateException if the computation detectably * attempts a recursive update to this map that would - * otherwise never complete. + * otherwise never complete * @throws RuntimeException or Error if the mappingFunction does so, - * in which case the mapping is left unestablished. + * in which case the mapping is left unestablished */ public V computeIfAbsent(K key, MappingFunction mappingFunction) { if (key == null || mappingFunction == null) @@ -1154,14 +1154,14 @@ public class ConcurrentHashMapV8 * @param mappingFunction the function to compute a value * @return the current value associated with * the specified key, or {@code null} if the computation - * returned {@code null} and the value was not otherwise present. + * returned {@code null} and the value was not otherwise present * @throws NullPointerException if the specified key or mappingFunction - * is null, + * is null * @throws IllegalStateException if the computation detectably * attempts a recursive update to this map that would - * otherwise never complete. + * otherwise never complete * @throws RuntimeException or Error if the mappingFunction does so, - * in which case the mapping is unchanged. + * in which case the mapping is unchanged */ public V compute(K key, MappingFunction mappingFunction) { if (key == null || mappingFunction == null) @@ -1624,7 +1624,7 @@ public class ConcurrentHashMapV8 throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); this.segments = null; // unneeded - // initalize transient final field + // initialize transient final field UNSAFE.putObjectVolatile(this, counterOffset, new LongAdder()); this.targetCapacity = DEFAULT_CAPACITY;