--- jsr166/src/jsr166e/ConcurrentHashMapV8.java 2012/08/13 18:15:39 1.54 +++ jsr166/src/jsr166e/ConcurrentHashMapV8.java 2012/08/14 05:55:08 1.58 @@ -712,7 +712,7 @@ public class ConcurrentHashMapV8 } /** - * Return the TreeNode (or null if not found) for the given key + * Returns the TreeNode (or null if not found) for the given key * starting at given root. */ @SuppressWarnings("unchecked") // suppress Comparable cast warning @@ -2327,7 +2327,7 @@ public class ConcurrentHashMapV8 } public final void remove() { - if (nextVal == null) + if (nextVal == null && last == null) advance(); Node e = last; if (e == null) @@ -2657,8 +2657,7 @@ public class ConcurrentHashMapV8 * * @param key key with which the specified value is to be associated * @param remappingFunction the function to compute a value - * @return the new value associated with - * the specified key, or null if none. + * @return the new value associated with the specified key, or null if none * @throws NullPointerException if the specified key or remappingFunction * is null * @throws IllegalStateException if the computation detectably @@ -2704,8 +2703,7 @@ public class ConcurrentHashMapV8 * * @param key key with which the specified value is to be associated * @param remappingFunction the function to compute a value - * @return the new value associated with - * the specified key, or null if none. + * @return the new value associated with the specified key, or null if none * @throws NullPointerException if the specified key or remappingFunction * is null * @throws IllegalStateException if the computation detectably @@ -2898,27 +2896,27 @@ public class ConcurrentHashMapV8 } /** - * Returns a partionable iterator of the keys in this map. + * Returns a partitionable iterator of the keys in this map. * - * @return a partionable iterator of the keys in this map + * @return a partitionable iterator of the keys in this map */ public Spliterator keySpliterator() { return new KeyIterator(this); } /** - * Returns a partionable iterator of the values in this map. + * Returns a partitionable iterator of the values in this map. * - * @return a partionable iterator of the values in this map + * @return a partitionable iterator of the values in this map */ public Spliterator valueSpliterator() { return new ValueIterator(this); } /** - * Returns a partionable iterator of the entries in this map. + * Returns a partitionable iterator of the entries in this map. * - * @return a partionable iterator of the entries in this map + * @return a partitionable iterator of the entries in this map */ public Spliterator> entrySpliterator() { return new EntryIterator(this); @@ -3750,7 +3748,7 @@ public class ConcurrentHashMapV8 } /** - * Performs the given action for each key + * Performs the given action for each key. * * @param action the action */ @@ -3761,7 +3759,7 @@ public class ConcurrentHashMapV8 /** * Performs the given action for each non-null transformation - * of each key + * of each key. * * @param transformer a function returning the transformation * for an element, or null of there is no transformation (in @@ -3880,7 +3878,7 @@ public class ConcurrentHashMapV8 } /** - * Performs the given action for each value + * Performs the given action for each value. * * @param action the action */ @@ -3891,7 +3889,7 @@ public class ConcurrentHashMapV8 /** * Performs the given action for each non-null transformation - * of each value + * of each value. * * @param transformer a function returning the transformation * for an element, or null of there is no transformation (in @@ -4009,7 +4007,7 @@ public class ConcurrentHashMapV8 } /** - * Perform the given action for each entry + * Performs the given action for each entry. * * @param action the action */ @@ -4019,8 +4017,8 @@ public class ConcurrentHashMapV8 } /** - * Perform the given action for each non-null transformation - * of each entry + * Performs the given action for each non-null transformation + * of each entry. * * @param transformer a function returning the transformation * for an element, or null of there is no transformation (in @@ -4304,7 +4302,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, performs the given action - * for each key + * for each key. * * @param map the map * @param action the action @@ -4319,7 +4317,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, performs the given action - * for each non-null transformation of each key + * for each non-null transformation of each key. * * @param map the map * @param transformer a function returning the transformation @@ -4376,6 +4374,7 @@ public class ConcurrentHashMapV8 return new ReduceKeysTask (map, reducer); } + /** * Returns a task that when invoked, returns the result of * accumulating the given transformation of all keys using the given @@ -4472,7 +4471,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, performs the given action - * for each value + * for each value. * * @param map the map * @param action the action @@ -4486,7 +4485,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, performs the given action - * for each non-null transformation of each value + * for each non-null transformation of each value. * * @param map the map * @param transformer a function returning the transformation @@ -4640,7 +4639,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, perform the given action - * for each entry + * for each entry. * * @param map the map * @param action the action @@ -4654,7 +4653,7 @@ public class ConcurrentHashMapV8 /** * Returns a task that when invoked, perform the given action - * for each non-null transformation of each entry + * for each non-null transformation of each entry. * * @param map the map * @param transformer a function returning the transformation @@ -4811,7 +4810,7 @@ public class ConcurrentHashMapV8 /** * Base for FJ tasks for bulk operations. This adds a variant of - * CountedCompleters and some split and merge bookeeping to + * CountedCompleters and some split and merge bookkeeping to * iterator functionality. The forEach and reduce methods are * similar to those illustrated in CountedCompleter documentation, * except that bottom-up reduction completions perform them within @@ -4842,7 +4841,7 @@ public class ConcurrentHashMapV8 // FJ methods /** - * Propagate completion. Note that all reduce actions + * Propagates completion. Note that all reduce actions * bypass this method to combine while completing. */ final void tryComplete() { @@ -4860,7 +4859,7 @@ public class ConcurrentHashMapV8 } /** - * Force root task to throw exception unless already complete. + * Forces root task to throw exception unless already complete. */ final void tryAbortComputation(Throwable ex) { for (BulkTask a = this;;) { @@ -4893,7 +4892,7 @@ public class ConcurrentHashMapV8 } /** - * Return approx exp2 of the number of times (minus one) to + * Returns approx exp2 of the number of times (minus one) to * split task by two before executing leaf action. This value * is faster to compute and more convenient to use as a guide * to splitting than is the depth, since it is used while @@ -4916,7 +4915,7 @@ public class ConcurrentHashMapV8 "Unexpected null function"; /** - * Return exportable snapshot entry + * Returns exportable snapshot entry. */ static AbstractMap.SimpleEntry entryFor(K k, V v) { return new AbstractMap.SimpleEntry(k, v);