--- jsr166/src/jsr166e/ConcurrentHashMapV8.java 2013/01/28 06:58:51 1.91 +++ jsr166/src/jsr166e/ConcurrentHashMapV8.java 2013/02/11 20:52:00 1.98 @@ -1977,7 +1977,7 @@ public class ConcurrentHashMapV8 } } - /* + /** * Moves and/or copies the nodes in each bin to new table. See * above for explanation. */ @@ -2894,8 +2894,7 @@ public class ConcurrentHashMapV8 * course only appropriate if it is acceptable to use the same * value for all additions from this view. * - * @param mappedValue the mapped value to use for any - * additions. + * @param mappedValue the mapped value to use for any additions * @return the set view * @throws NullPointerException if the mappedValue is null */ @@ -3374,7 +3373,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ @SuppressWarnings("unchecked") public void forEachSequentially @@ -3418,7 +3417,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all (key, value) pairs @@ -3531,7 +3530,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ @SuppressWarnings("unchecked") public void forEachKeySequentially @@ -3596,7 +3595,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all keys @@ -3709,7 +3708,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) */ public void forEachValueSequentially (Fun transformer, @@ -3769,7 +3768,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all values @@ -3883,7 +3882,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ @SuppressWarnings("unchecked") public void forEachEntrySequentially @@ -3946,7 +3945,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all entries @@ -4058,7 +4057,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ public void forEachInParallel @@ -4093,7 +4092,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all (key, value) pairs @@ -4181,7 +4180,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ public void forEachKeyInParallel @@ -4230,7 +4229,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all keys @@ -4318,7 +4317,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) */ public void forEachValueInParallel (Fun transformer, @@ -4365,7 +4364,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all values @@ -4453,7 +4452,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case the action is not applied). + * which case the action is not applied) * @param action the action */ public void forEachEntryInParallel @@ -4501,7 +4500,7 @@ public class ConcurrentHashMapV8 * * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the result of accumulating the given transformation * of all entries @@ -4716,7 +4715,7 @@ public class ConcurrentHashMapV8 * A view of a ConcurrentHashMapV8 as a {@link Set} of keys, in * which additions may optionally be enabled by mapping to a * common value. This class cannot be directly instantiated. See - * {@link #keySet}, {@link #keySet(Object)}, {@link #newKeySet()}, + * {@link #keySet()}, {@link #keySet(Object)}, {@link #newKeySet()}, * {@link #newKeySet(int)}. */ public static class KeySetView extends CHMView @@ -4733,7 +4732,7 @@ public class ConcurrentHashMapV8 * or {@code null} if additions are not supported. * * @return the default mapped value for additions, or {@code null} - * if not supported. + * if not supported */ public V getMappedValue() { return value; } @@ -4757,8 +4756,6 @@ public class ConcurrentHashMapV8 V v; if ((v = value) == null) throw new UnsupportedOperationException(); - if (e == null) - throw new NullPointerException(); return map.internalPut(e, v, true) == null; } public boolean addAll(Collection c) { @@ -4767,8 +4764,6 @@ public class ConcurrentHashMapV8 if ((v = value) == null) throw new UnsupportedOperationException(); for (K e : c) { - if (e == null) - throw new NullPointerException(); if (map.internalPut(e, v, true) == null) added = true; } @@ -4785,7 +4780,7 @@ public class ConcurrentHashMapV8 /** * A view of a ConcurrentHashMapV8 as a {@link Collection} of * values, in which additions are disabled. This class cannot be - * directly instantiated. See {@link #values}, + * directly instantiated. See {@link #values()}. * *

The view's {@code iterator} is a "weakly consistent" iterator * that will never throw {@link ConcurrentModificationException}, @@ -4835,7 +4830,7 @@ public class ConcurrentHashMapV8 /** * A view of a ConcurrentHashMapV8 as a {@link Set} of (key, value) * entries. This class cannot be directly instantiated. See - * {@link #entrySet}. + * {@link #entrySet()}. */ public static final class EntrySetView extends CHMView implements Set> { @@ -4871,11 +4866,7 @@ public class ConcurrentHashMapV8 } public final boolean add(Entry e) { - K key = e.getKey(); - V value = e.getValue(); - if (key == null || value == null) - throw new NullPointerException(); - return map.internalPut(key, value, false) == null; + return map.internalPut(e.getKey(), e.getValue(), false) == null; } public final boolean addAll(Collection> c) { boolean added = false; @@ -4972,7 +4963,7 @@ public class ConcurrentHashMapV8 * @param map the map * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the task */ @@ -5139,7 +5130,7 @@ public class ConcurrentHashMapV8 * @param map the map * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the task */ @@ -5305,7 +5296,7 @@ public class ConcurrentHashMapV8 * @param map the map * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the task */ @@ -5471,7 +5462,7 @@ public class ConcurrentHashMapV8 * @param map the map * @param transformer a function returning the transformation * for an element, or null if there is no transformation (in - * which case it is not combined). + * which case it is not combined) * @param reducer a commutative associative combining function * @return the task */