Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedMap.java Mon Jun 22 13:00:27 2015 @@ -70,7 +70,7 @@ public class TransformedMap<K, V> * @param keyTransformer the transformer to use for key conversion, null means no transformation * @param valueTransformer the transformer to use for value conversion, null means no transformation * @return a new transformed map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> TransformedMap<K, V> transformingMap(final Map<K, V> map, @@ -93,7 +93,7 @@ public class TransformedMap<K, V> * @param keyTransformer the transformer to use for key conversion, null means no transformation * @param valueTransformer the transformer to use for value conversion, null means no transformation * @return a new transformed map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> TransformedMap<K, V> transformedMap(final Map<K, V> map, @@ -118,7 +118,7 @@ public class TransformedMap<K, V> * @param map the map to decorate, must not be null * @param keyTransformer the transformer to use for key conversion, null means no conversion * @param valueTransformer the transformer to use for value conversion, null means no conversion - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null */ protected TransformedMap(final Map<K, V> map, final Transformer<? super K, ? extends K> keyTransformer, final Transformer<? super V, ? extends V> valueTransformer) {
Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/TransformedSortedMap.java Mon Jun 22 13:00:27 2015 @@ -60,7 +60,7 @@ public class TransformedSortedMap<K, V> * @param keyTransformer the predicate to validate the keys, null means no transformation * @param valueTransformer the predicate to validate to values, null means no transformation * @return a new transformed sorted map - * @throws IllegalArgumentException if the map is null + * @throws NullPointerException if the map is null * @since 4.0 */ public static <K, V> TransformedSortedMap<K, V> transformingSortedMap(final SortedMap<K, V> map, @@ -83,7 +83,7 @@ public class TransformedSortedMap<K, V> * @param keyTransformer the transformer to use for key conversion, null means no transformation * @param valueTransformer the transformer to use for value conversion, null means no transformation * @return a new transformed sorted map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> TransformedSortedMap<K, V> transformedSortedMap(final SortedMap<K, V> map, @@ -110,7 +110,7 @@ public class TransformedSortedMap<K, V> * @param map the map to decorate, must not be null * @param keyTransformer the predicate to validate the keys, null means no transformation * @param valueTransformer the predicate to validate to values, null means no transformation - * @throws IllegalArgumentException if the map is null + * @throws NullPointerException if the map is null */ protected TransformedSortedMap(final SortedMap<K, V> map, final Transformer<? super K, ? extends K> keyTransformer, Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableEntrySet.java Mon Jun 22 13:00:27 2015 @@ -22,10 +22,10 @@ import java.util.Iterator; import java.util.Map; import java.util.Set; -import org.apache.commons.collections4.set.AbstractSetDecorator; import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.iterators.AbstractIteratorDecorator; import org.apache.commons.collections4.keyvalue.AbstractMapEntryDecorator; +import org.apache.commons.collections4.set.AbstractSetDecorator; /** * Decorates a map entry <code>Set</code> to ensure it can't be altered. @@ -48,7 +48,7 @@ public final class UnmodifiableEntrySet< * @param <V> the value type * @param set the set to decorate, must not be null * @return a new unmodifiable entry set - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null * @since 4.0 */ public static <K, V> Set<Map.Entry<K, V>> unmodifiableEntrySet(final Set<Map.Entry<K, V>> set) { @@ -63,7 +63,7 @@ public final class UnmodifiableEntrySet< * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ private UnmodifiableEntrySet(final Set<Map.Entry<K, V>> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java Mon Jun 22 13:00:27 2015 @@ -24,13 +24,13 @@ import java.util.Collection; import java.util.Map; import java.util.Set; -import org.apache.commons.collections4.set.UnmodifiableSet; import org.apache.commons.collections4.IterableMap; import org.apache.commons.collections4.MapIterator; import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.collection.UnmodifiableCollection; import org.apache.commons.collections4.iterators.EntrySetMapIterator; import org.apache.commons.collections4.iterators.UnmodifiableMapIterator; +import org.apache.commons.collections4.set.UnmodifiableSet; /** * Decorates another <code>Map</code> to ensure it can't be altered. @@ -56,7 +56,7 @@ public final class UnmodifiableMap<K, V> * @param <V> the value type * @param map the map to decorate, must not be null * @return a new unmodifiable map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) { @@ -73,7 +73,7 @@ public final class UnmodifiableMap<K, V> * Constructor that wraps (not copies). * * @param map the map to decorate, must not be null - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null */ @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableMap(final Map<? extends K, ? extends V> map) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java Mon Jun 22 13:00:27 2015 @@ -24,12 +24,12 @@ import java.util.Collection; import java.util.Map; import java.util.Set; -import org.apache.commons.collections4.set.UnmodifiableSet; import org.apache.commons.collections4.OrderedMap; import org.apache.commons.collections4.OrderedMapIterator; import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.collection.UnmodifiableCollection; import org.apache.commons.collections4.iterators.UnmodifiableOrderedMapIterator; +import org.apache.commons.collections4.set.UnmodifiableSet; /** * Decorates another <code>OrderedMap</code> to ensure it can't be altered. @@ -54,7 +54,7 @@ public final class UnmodifiableOrderedMa * @param <V> the value type * @param map the map to decorate, must not be null * @return a new ordered map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> OrderedMap<K, V> unmodifiableOrderedMap(final OrderedMap<? extends K, ? extends V> map) { @@ -71,7 +71,7 @@ public final class UnmodifiableOrderedMa * Constructor that wraps (not copies). * * @param map the map to decorate, must not be null - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null */ @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableOrderedMap(final OrderedMap<? extends K, ? extends V> map) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java Mon Jun 22 13:00:27 2015 @@ -26,9 +26,9 @@ import java.util.Map; import java.util.Set; import java.util.SortedMap; -import org.apache.commons.collections4.set.UnmodifiableSet; import org.apache.commons.collections4.Unmodifiable; import org.apache.commons.collections4.collection.UnmodifiableCollection; +import org.apache.commons.collections4.set.UnmodifiableSet; /** * Decorates another <code>SortedMap</code> to ensure it can't be altered. @@ -54,7 +54,7 @@ public final class UnmodifiableSortedMap * @param <V> the value type * @param map the map to decorate, must not be null * @return a new unmodifiable sorted map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <K, V> SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, ? extends V> map) { @@ -71,7 +71,7 @@ public final class UnmodifiableSortedMap * Constructor that wraps (not copies). * * @param map the map to decorate, must not be null - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null */ @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableSortedMap(final SortedMap<K, ? extends V> map) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMap.java Mon Jun 22 13:00:27 2015 @@ -269,6 +269,7 @@ public abstract class AbstractMultiValue * progress. * * @param map mappings to be stored in this map, may not be null + * @return true if the map changed as a result of this operation * @throws NullPointerException if map is null */ @Override @@ -292,6 +293,7 @@ public abstract class AbstractMultiValue * while the operation is in progress. * * @param map mappings to be stored in this map, may not be null + * @return true if the map changed as a result of this operation * @throws NullPointerException if map is null */ @Override Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/multiset/AbstractMultiSetDecorator.java Mon Jun 22 13:00:27 2015 @@ -46,7 +46,7 @@ public abstract class AbstractMultiSetDe * Constructor that wraps (not copies). * * @param multiset the multiset to decorate, must not be null - * @throws IllegalArgumentException if multiset is null + * @throws NullPointerException if multiset is null */ protected AbstractMultiSetDecorator(final MultiSet<E> multiset) { super(multiset); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/AbstractQueueDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/AbstractQueueDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/AbstractQueueDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/AbstractQueueDecorator.java Mon Jun 22 13:00:27 2015 @@ -52,7 +52,7 @@ public abstract class AbstractQueueDecor * Constructor that wraps (not copies). * * @param queue the queue to decorate, must not be null - * @throws IllegalArgumentException if list is null + * @throws NullPointerException if queue is null */ protected AbstractQueueDecorator(final Queue<E> queue) { super(queue); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/PredicatedQueue.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/PredicatedQueue.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/PredicatedQueue.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/PredicatedQueue.java Mon Jun 22 13:00:27 2015 @@ -50,7 +50,7 @@ public class PredicatedQueue<E> extends * @param Queue the queue to decorate, must not be null * @param predicate the predicate to use for validation, must not be null * @return a new predicated queue - * @throws IllegalArgumentException if queue or predicate is null + * @throws NullPointerException if queue or predicate is null * @throws IllegalArgumentException if the queue contains invalid elements */ public static <E> PredicatedQueue<E> predicatedQueue(final Queue<E> Queue, @@ -67,7 +67,7 @@ public class PredicatedQueue<E> extends * * @param queue the queue to decorate, must not be null * @param predicate the predicate to use for validation, must not be null - * @throws IllegalArgumentException if Queue or predicate is null + * @throws NullPointerException if queue or predicate is null * @throws IllegalArgumentException if the Queue contains invalid elements */ protected PredicatedQueue(final Queue<E> queue, final Predicate<? super E> predicate) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/TransformedQueue.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/TransformedQueue.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/TransformedQueue.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/TransformedQueue.java Mon Jun 22 13:00:27 2015 @@ -48,7 +48,7 @@ public class TransformedQueue<E> extends * @param queue the queue to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed Queue - * @throws IllegalArgumentException if queue or transformer is null + * @throws NullPointerException if queue or transformer is null */ public static <E> TransformedQueue<E> transformingQueue(final Queue<E> queue, final Transformer<? super E, ? extends E> transformer) { @@ -67,7 +67,7 @@ public class TransformedQueue<E> extends * @param queue the queue to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed Queue - * @throws IllegalArgumentException if queue or transformer is null + * @throws NullPointerException if queue or transformer is null * @since 4.0 */ public static <E> TransformedQueue<E> transformedQueue(final Queue<E> queue, @@ -94,7 +94,7 @@ public class TransformedQueue<E> extends * * @param queue the queue to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null - * @throws IllegalArgumentException if queue or transformer is null + * @throws NullPointerException if queue or transformer is null */ protected TransformedQueue(final Queue<E> queue, final Transformer<? super E, ? extends E> transformer) { super(queue, transformer); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java Mon Jun 22 13:00:27 2015 @@ -49,7 +49,7 @@ public final class UnmodifiableQueue<E> * @param <E> the type of the elements in the queue * @param queue the queue to decorate, must not be null * @return an unmodifiable Queue - * @throws IllegalArgumentException if queue is null + * @throws NullPointerException if queue is null */ public static <E> Queue<E> unmodifiableQueue(final Queue<? extends E> queue) { if (queue instanceof Unmodifiable) { @@ -65,7 +65,7 @@ public final class UnmodifiableQueue<E> * Constructor that wraps (not copies). * * @param queue the queue to decorate, must not be null - * @throws IllegalArgumentException if queue is null + * @throws NullPointerException if queue is null */ @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableQueue(final Queue<? extends E> queue) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractNavigableSetDecorator.java Mon Jun 22 13:00:27 2015 @@ -46,7 +46,7 @@ public abstract class AbstractNavigableS * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ protected AbstractNavigableSetDecorator(final NavigableSet<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSerializableSetDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSerializableSetDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSerializableSetDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSerializableSetDecorator.java Mon Jun 22 13:00:27 2015 @@ -38,7 +38,7 @@ public abstract class AbstractSerializab * Constructor. * * @param set the list to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ protected AbstractSerializableSetDecorator(final Set<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSetDecorator.java Mon Jun 22 13:00:27 2015 @@ -47,7 +47,7 @@ public abstract class AbstractSetDecorat * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ protected AbstractSetDecorator(final Set<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/AbstractSortedSetDecorator.java Mon Jun 22 13:00:27 2015 @@ -48,7 +48,7 @@ public abstract class AbstractSortedSetD * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ protected AbstractSortedSetDecorator(final Set<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/ListOrderedSet.java Mon Jun 22 13:00:27 2015 @@ -70,16 +70,16 @@ public class ListOrderedSet<E> * @param set the set to decorate, must be empty and not null * @param list the list to decorate, must be empty and not null * @return a new ordered set - * @throws IllegalArgumentException if set or list is null + * @throws NullPointerException if set or list is null * @throws IllegalArgumentException if either the set or list is not empty * @since 4.0 */ public static <E> ListOrderedSet<E> listOrderedSet(final Set<E> set, final List<E> list) { if (set == null) { - throw new IllegalArgumentException("Set must not be null"); + throw new NullPointerException("Set must not be null"); } if (list == null) { - throw new IllegalArgumentException("List must not be null"); + throw new NullPointerException("List must not be null"); } if (set.size() > 0 || list.size() > 0) { throw new IllegalArgumentException("Set and List must be empty"); @@ -95,7 +95,7 @@ public class ListOrderedSet<E> * @param <E> the element type * @param set the set to decorate, must not be null * @return a new ordered set - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null * @since 4.0 */ public static <E> ListOrderedSet<E> listOrderedSet(final Set<E> set) { @@ -113,12 +113,12 @@ public class ListOrderedSet<E> * @param <E> the element type * @param list the list to decorate, must not be null * @return a new ordered set - * @throws IllegalArgumentException if list is null + * @throws NullPointerException if list is null * @since 4.0 */ public static <E> ListOrderedSet<E> listOrderedSet(final List<E> list) { if (list == null) { - throw new IllegalArgumentException("List must not be null"); + throw new NullPointerException("List must not be null"); } CollectionUtils.filter(list, UniquePredicate.uniquePredicate()); final Set<E> set = new HashSet<E>(list); @@ -157,12 +157,12 @@ public class ListOrderedSet<E> * * @param set the set to decorate, must not be null * @param list the list to decorate, must not be null - * @throws IllegalArgumentException if set or list is null + * @throws NullPointerException if set or list is null */ protected ListOrderedSet(final Set<E> set, final List<E> list) { super(set); if (list == null) { - throw new IllegalArgumentException("List must not be null"); + throw new NullPointerException("List must not be null"); } setOrder = list; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/MapBackedSet.java Mon Jun 22 13:00:27 2015 @@ -53,7 +53,7 @@ public final class MapBackedSet<E, V> im * @param <V> the dummy value type in the map * @param map the map to decorate, must not be null * @return a new map backed set - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <E, V> MapBackedSet<E, V> mapBackedSet(final Map<E, ? super V> map) { @@ -68,13 +68,10 @@ public final class MapBackedSet<E, V> im * @param map the map to decorate, must not be null * @param dummyValue the dummy value to use * @return a new map backed set - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null * @since 4.0 */ public static <E, V> MapBackedSet<E, V> mapBackedSet(final Map<E, ? super V> map, final V dummyValue) { - if (map == null) { - throw new IllegalArgumentException("The map must not be null"); - } return new MapBackedSet<E, V>(map, dummyValue); } @@ -84,10 +81,13 @@ public final class MapBackedSet<E, V> im * * @param map the map to decorate, must not be null * @param dummyValue the dummy value to use - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map is null */ private MapBackedSet(final Map<E, ? super V> map, final V dummyValue) { super(); + if (map == null) { + throw new NullPointerException("The map must not be null"); + } this.map = map; this.dummyValue = dummyValue; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedNavigableSet.java Mon Jun 22 13:00:27 2015 @@ -54,7 +54,7 @@ public class PredicatedNavigableSet<E> e * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null * @return a new predicated navigable set. - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements * @since 4.0 */ @@ -72,7 +72,7 @@ public class PredicatedNavigableSet<E> e * * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements */ protected PredicatedNavigableSet(final NavigableSet<E> set, final Predicate<? super E> predicate) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSet.java Mon Jun 22 13:00:27 2015 @@ -52,7 +52,7 @@ public class PredicatedSet<E> extends Pr * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null * @return a decorated set - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements * @since 4.0 */ @@ -69,7 +69,7 @@ public class PredicatedSet<E> extends Pr * * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements */ protected PredicatedSet(final Set<E> set, final Predicate<? super E> predicate) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/PredicatedSortedSet.java Mon Jun 22 13:00:27 2015 @@ -56,7 +56,7 @@ public class PredicatedSortedSet<E> exte * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null * @return a new predicated sorted set. - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements * @since 4.0 */ @@ -74,7 +74,7 @@ public class PredicatedSortedSet<E> exte * * @param set the set to decorate, must not be null * @param predicate the predicate to use for validation, must not be null - * @throws IllegalArgumentException if set or predicate is null + * @throws NullPointerException if set or predicate is null * @throws IllegalArgumentException if the set contains invalid elements */ protected PredicatedSortedSet(final SortedSet<E> set, final Predicate<? super E> predicate) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedNavigableSet.java Mon Jun 22 13:00:27 2015 @@ -48,7 +48,7 @@ public class TransformedNavigableSet<E> * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed {@link NavigableSet} - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null */ public static <E> TransformedNavigableSet<E> transformingNavigableSet(final NavigableSet<E> set, final Transformer<? super E, ? extends E> transformer) { @@ -67,13 +67,13 @@ public class TransformedNavigableSet<E> * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed {@link NavigableSet} - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null */ public static <E> TransformedNavigableSet<E> transformedNavigableSet(final NavigableSet<E> set, final Transformer<? super E, ? extends E> transformer) { final TransformedNavigableSet<E> decorated = new TransformedNavigableSet<E>(set, transformer); - if (transformer != null && set != null && set.size() > 0) { + if (set.size() > 0) { @SuppressWarnings("unchecked") // set is type E final E[] values = (E[]) set.toArray(); // NOPMD - false positive for generics set.clear(); @@ -93,7 +93,7 @@ public class TransformedNavigableSet<E> * * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null */ protected TransformedNavigableSet(final NavigableSet<E> set, final Transformer<? super E, ? extends E> transformer) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSet.java Mon Jun 22 13:00:27 2015 @@ -50,7 +50,7 @@ public class TransformedSet<E> extends T * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed set - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null * @since 4.0 */ public static <E> TransformedSet<E> transformingSet(final Set<E> set, @@ -70,12 +70,12 @@ public class TransformedSet<E> extends T * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed set - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null * @since 4.0 */ public static <E> Set<E> transformedSet(final Set<E> set, final Transformer<? super E, ? extends E> transformer) { final TransformedSet<E> decorated = new TransformedSet<E>(set, transformer); - if (transformer != null && set != null && set.size() > 0) { + if (set.size() > 0) { @SuppressWarnings("unchecked") // set is type E final E[] values = (E[]) set.toArray(); // NOPMD - false positive for generics set.clear(); @@ -95,7 +95,7 @@ public class TransformedSet<E> extends T * * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null */ protected TransformedSet(final Set<E> set, final Transformer<? super E, ? extends E> transformer) { super(set, transformer); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/TransformedSortedSet.java Mon Jun 22 13:00:27 2015 @@ -50,7 +50,7 @@ public class TransformedSortedSet<E> ext * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed {@link SortedSet} - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null * @since 4.0 */ public static <E> TransformedSortedSet<E> transformingSortedSet(final SortedSet<E> set, @@ -70,14 +70,14 @@ public class TransformedSortedSet<E> ext * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null * @return a new transformed {@link SortedSet} - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null * @since 4.0 */ public static <E> TransformedSortedSet<E> transformedSortedSet(final SortedSet<E> set, final Transformer<? super E, ? extends E> transformer) { final TransformedSortedSet<E> decorated = new TransformedSortedSet<E>(set, transformer); - if (transformer != null && set != null && set.size() > 0) { + if (set.size() > 0) { @SuppressWarnings("unchecked") // set is type E final E[] values = (E[]) set.toArray(); // NOPMD - false positive for generics set.clear(); @@ -97,7 +97,7 @@ public class TransformedSortedSet<E> ext * * @param set the set to decorate, must not be null * @param transformer the transformer to use for conversion, must not be null - * @throws IllegalArgumentException if set or transformer is null + * @throws NullPointerException if set or transformer is null */ protected TransformedSortedSet(final SortedSet<E> set, final Transformer<? super E, ? extends E> transformer) { super(set, transformer); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableNavigableSet.java Mon Jun 22 13:00:27 2015 @@ -48,7 +48,7 @@ public final class UnmodifiableNavigable * @param <E> the element type * @param set the set to decorate, must not be null * @return a new unmodifiable {@link NavigableSet} - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ public static <E> NavigableSet<E> unmodifiableNavigableSet(final NavigableSet<E> set) { if (set instanceof Unmodifiable) { @@ -62,7 +62,7 @@ public final class UnmodifiableNavigable * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ private UnmodifiableNavigableSet(final NavigableSet<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java Mon Jun 22 13:00:27 2015 @@ -46,7 +46,7 @@ public final class UnmodifiableSet<E> * @param <E> the element type * @param set the set to decorate, must not be null * @return a new unmodifiable set - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null * @since 4.0 */ public static <E> Set<E> unmodifiableSet(final Set<? extends E> set) { @@ -63,7 +63,7 @@ public final class UnmodifiableSet<E> * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ @SuppressWarnings("unchecked") // safe to upcast private UnmodifiableSet(final Set<? extends E> set) { Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSortedSet.java Mon Jun 22 13:00:27 2015 @@ -49,7 +49,7 @@ public final class UnmodifiableSortedSet * @param <E> the element type * @param set the set to decorate, must not be null * @return a new unmodifiable {@link SortedSet} - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null * @since 4.0 */ public static <E> SortedSet<E> unmodifiableSortedSet(final SortedSet<E> set) { @@ -64,7 +64,7 @@ public final class UnmodifiableSortedSet * Constructor that wraps (not copies). * * @param set the set to decorate, must not be null - * @throws IllegalArgumentException if set is null + * @throws NullPointerException if set is null */ private UnmodifiableSortedSet(final SortedSet<E> set) { super(set); Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/AbstractIterableGetMapDecorator.java Mon Jun 22 13:00:27 2015 @@ -38,10 +38,14 @@ public class AbstractIterableGetMapDecor /** * Create a new AbstractSplitMapDecorator. - * @param decorated the Map to decorate + * @param map the map to decorate, must not be null + * @throws NullPointerException if map is null */ - public AbstractIterableGetMapDecorator(final Map<K, V> decorated) { - this.map = decorated; + public AbstractIterableGetMapDecorator(final Map<K, V> map) { + if (map == null) { + throw new NullPointerException("Map must not be null."); + } + this.map = map; } /** Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/splitmap/TransformedSplitMap.java Mon Jun 22 13:00:27 2015 @@ -55,7 +55,7 @@ import org.apache.commons.collections4.m * @since 4.0 * @version $Id$ * - * @see org.apache.commons.collections4.SplitMapUtils#readableMap(Get) + * @see org.apache.commons.collections4.SplitMapUtils#readableMap(org.apache.commons.collections4.Get) * @see org.apache.commons.collections4.SplitMapUtils#writableMap(Put) */ public class TransformedSplitMap<J, K, U, V> extends AbstractIterableGetMapDecorator<K, V> @@ -80,12 +80,10 @@ public class TransformedSplitMap<J, K, U * @param <U> the input value type * @param <V> the output value type * @param map the map to decorate, must not be null - * @param keyTransformer the transformer to use for key conversion, null - * means no transformation - * @param valueTransformer the transformer to use for value conversion, null - * means no transformation + * @param keyTransformer the transformer to use for key conversion, must not be null + * @param valueTransformer the transformer to use for value conversion, must not be null * @return a new transformed map - * @throws IllegalArgumentException if map is null + * @throws NullPointerException if map or either of the transformers is null */ public static <J, K, U, V> TransformedSplitMap<J, K, U, V> transformingMap(final Map<K, V> map, final Transformer<? super J, ? extends K> keyTransformer, @@ -101,21 +99,19 @@ public class TransformedSplitMap<J, K, U * are NOT transformed. * * @param map the map to decorate, must not be null - * @param keyTransformer the transformer to use for key conversion, null - * means no conversion - * @param valueTransformer the transformer to use for value conversion, null - * means no conversion - * @throws IllegalArgumentException if map is null + * @param keyTransformer the transformer to use for key conversion, must not be null + * @param valueTransformer the transformer to use for value conversion, must not be null + * @throws NullPointerException if map or either of the transformers is null */ protected TransformedSplitMap(final Map<K, V> map, final Transformer<? super J, ? extends K> keyTransformer, final Transformer<? super U, ? extends V> valueTransformer) { super(map); if (keyTransformer == null) { - throw new IllegalArgumentException("keyTransformer cannot be null"); + throw new NullPointerException("KeyTransformer must not be null."); } this.keyTransformer = keyTransformer; if (valueTransformer == null) { - throw new IllegalArgumentException("valueTransformer cannot be null"); + throw new NullPointerException("ValueTransformer must not be null."); } this.valueTransformer = valueTransformer; } Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java (original) +++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java Mon Jun 22 13:00:27 2015 @@ -49,7 +49,7 @@ public class UnmodifiableTrie<K, V> impl * @param <V> the value type * @param trie the trie to decorate, must not be null * @return a new unmodifiable trie - * @throws IllegalArgumentException if trie is null + * @throws NullPointerException if trie is null */ public static <K, V> Trie<K, V> unmodifiableTrie(final Trie<K, ? extends V> trie) { if (trie instanceof Unmodifiable) { @@ -65,11 +65,11 @@ public class UnmodifiableTrie<K, V> impl * Constructor that wraps (not copies). * * @param trie the trie to decorate, must not be null - * @throws IllegalArgumentException if trie is null + * @throws NullPointerException if trie is null */ public UnmodifiableTrie(final Trie<K, ? extends V> trie) { if (trie == null) { - throw new IllegalArgumentException("Trie must not be null"); + throw new NullPointerException("Trie must not be null"); } @SuppressWarnings("unchecked") // safe to upcast final Trie<K, V> tmpTrie = (Trie<K, V>) trie; Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/BagUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -16,9 +16,7 @@ */ package org.apache.commons.collections4; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import org.apache.commons.collections4.bag.HashBag; import org.apache.commons.collections4.bag.PredicatedBag; @@ -52,8 +50,8 @@ public class BagUtilsTest { bag instanceof SynchronizedBag); try { BagUtils.synchronizedBag(null); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } } @@ -65,8 +63,8 @@ public class BagUtilsTest { bag instanceof UnmodifiableBag); try { BagUtils.unmodifiableBag(null); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } @@ -80,14 +78,14 @@ public class BagUtilsTest { bag instanceof PredicatedBag); try { BagUtils.predicatedBag(null,truePredicate); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } try { BagUtils.predicatedBag(new HashBag<Object>(), null); - fail("Expecting IllegalArgumentException for null predicate."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null predicate."); + } catch (final NullPointerException ex) { // expected } } @@ -99,14 +97,14 @@ public class BagUtilsTest { bag instanceof TransformedBag); try { BagUtils.transformingBag(null, nopTransformer); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } try { BagUtils.transformingBag(new HashBag<Object>(), null); - fail("Expecting IllegalArgumentException for null transformer."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null transformer."); + } catch (final NullPointerException ex) { // expected } } @@ -118,8 +116,8 @@ public class BagUtilsTest { bag instanceof SynchronizedSortedBag); try { BagUtils.synchronizedSortedBag(null); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } } @@ -131,8 +129,8 @@ public class BagUtilsTest { bag instanceof UnmodifiableSortedBag); try { BagUtils.unmodifiableSortedBag(null); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } @@ -146,14 +144,14 @@ public class BagUtilsTest { bag instanceof PredicatedSortedBag); try { BagUtils.predicatedSortedBag(null, truePredicate); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } try { BagUtils.predicatedSortedBag(new TreeBag<Object>(), null); - fail("Expecting IllegalArgumentException for null predicate."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null predicate."); + } catch (final NullPointerException ex) { // expected } } @@ -165,14 +163,14 @@ public class BagUtilsTest { bag instanceof TransformedSortedBag); try { BagUtils.transformingSortedBag(null, nopTransformer); - fail("Expecting IllegalArgumentException for null bag."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null bag."); + } catch (final NullPointerException ex) { // expected } try { BagUtils.transformingSortedBag(new TreeBag<Object>(), null); - fail("Expecting IllegalArgumentException for null transformer."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null transformer."); + } catch (final NullPointerException ex) { // expected } } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ClosureUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -16,10 +16,7 @@ */ package org.apache.commons.collections4; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Collection; @@ -140,15 +137,15 @@ public class ClosureUtilsTest { try { ClosureUtils.whileClosure(null, ClosureUtils.nopClosure()); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.whileClosure(FalsePredicate.falsePredicate(), null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.whileClosure(null, null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} } // doWhileClosure @@ -167,7 +164,7 @@ public class ClosureUtilsTest { try { ClosureUtils.doWhileClosure(null, null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} } // chainedClosure @@ -204,26 +201,26 @@ public class ClosureUtilsTest { try { ClosureUtils.chainedClosure(null, null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<Object>chainedClosure((Closure[]) null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<Object>chainedClosure((Collection<Closure<Object>>) null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<Object>chainedClosure(new Closure[] {null, null}); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { coll = new ArrayList<Closure<Object>>(); coll.add(null); coll.add(null); ClosureUtils.chainedClosure(coll); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} } // ifClosure @@ -324,19 +321,19 @@ public class ClosureUtilsTest { try { ClosureUtils.switchClosure(null, null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<String>switchClosure((Predicate<String>[]) null, (Closure<String>[]) null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<String>switchClosure((Map<Predicate<String>, Closure<String>>) null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<String>switchClosure(new Predicate[2], new Closure[2]); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} try { ClosureUtils.<String>switchClosure( new Predicate[] { TruePredicate.<String>truePredicate() }, @@ -385,7 +382,7 @@ public class ClosureUtilsTest { try { ClosureUtils.switchMapClosure(null); fail(); - } catch (final IllegalArgumentException ex) {} + } catch (final NullPointerException ex) {} } // asClosure Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/CollectionUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -581,7 +581,7 @@ public class CollectionUtilsTest extends assertFalse(CollectionUtils.isEqualCollection(collectionA, collB, defaultEquator)); } - @Test(expected=IllegalArgumentException.class) + @Test(expected=NullPointerException.class) public void testIsEqualCollectionNullEquator() { CollectionUtils.isEqualCollection(collectionA, collectionA, null); } @@ -1324,14 +1324,14 @@ public class CollectionUtilsTest extends assertTrue("returned object should be a PredicatedCollection", collection instanceof PredicatedCollection); try { CollectionUtils.predicatedCollection(new ArrayList<Number>(), null); - fail("Expecting IllegalArgumentException for null predicate."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null predicate."); + } catch (final NullPointerException ex) { // expected } try { CollectionUtils.predicatedCollection(null, predicate); - fail("Expecting IllegalArgumentException for null collection."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null collection."); + } catch (final NullPointerException ex) { // expected } } @@ -1499,14 +1499,14 @@ public class CollectionUtilsTest extends assertTrue("returned object should be a TransformedCollection", collection instanceof TransformedCollection); try { CollectionUtils.transformingCollection(new ArrayList<Object>(), null); - fail("Expecting IllegalArgumentException for null transformer."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null transformer."); + } catch (final NullPointerException ex) { // expected } try { CollectionUtils.transformingCollection(null, transformer); - fail("Expecting IllegalArgumentException for null collection."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null collection."); + } catch (final NullPointerException ex) { // expected } } @@ -1543,8 +1543,8 @@ public class CollectionUtilsTest extends assertTrue("Returned object should be a UnmodifiableCollection.", col instanceof UnmodifiableCollection); try { CollectionUtils.unmodifiableCollection(null); - fail("Expecting IllegalArgumentException for null collection."); - } catch (final IllegalArgumentException ex) { + fail("Expecting NullPointerException for null collection."); + } catch (final NullPointerException ex) { // expected } } @@ -1676,8 +1676,8 @@ public class CollectionUtilsTest extends ArrayList<String> coll = null; try { CollectionUtils.extractSingleton(coll); - fail("expected IllegalArgumentException from extractSingleton(null)"); - } catch (final IllegalArgumentException e) { + fail("expected NullPointerException from extractSingleton(null)"); + } catch (final NullPointerException e) { } coll = new ArrayList<String>(); try { @@ -1703,12 +1703,12 @@ public class CollectionUtilsTest extends expect(iterator.next()).andReturn(t); } - @Test(expected=IllegalArgumentException.class) + @Test(expected=NullPointerException.class) public void collateException1() { CollectionUtils.collate(collectionA, null); } - @Test(expected=IllegalArgumentException.class) + @Test(expected=NullPointerException.class) public void collateException2() { CollectionUtils.collate(collectionA, collectionC, null); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/FactoryUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -16,12 +16,7 @@ */ package org.apache.commons.collections4; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -254,7 +249,7 @@ public class FactoryUtilsTest { // instantiateFactory //------------------------------------------------------------------ - @Test(expected=IllegalArgumentException.class) + @Test(expected=NullPointerException.class) public void instantiateFactoryNull() { FactoryUtils.instantiateFactory(null); } Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/ListUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -16,11 +16,7 @@ */ package org.apache.commons.collections4; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; @@ -137,13 +133,13 @@ public class ListUtilsTest { try { ListUtils.predicatedList(new ArrayList<Object>(), null); fail("Expecting IllegalArgumentException for null predicate."); - } catch (final IllegalArgumentException ex) { + } catch (final NullPointerException ex) { // expected } try { ListUtils.predicatedList(null, predicate); fail("Expecting IllegalArgumentException for null list."); - } catch (final IllegalArgumentException ex) { + } catch (final NullPointerException ex) { // expected } } @@ -326,17 +322,17 @@ public class ListUtilsTest { try { ListUtils.longestCommonSubsequence((List<?>) null, null); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} try { ListUtils.longestCommonSubsequence(Arrays.asList('A'), null); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} try { ListUtils.longestCommonSubsequence(null, Arrays.asList('A')); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} @SuppressWarnings("unchecked") List<Character> lcs = ListUtils.longestCommonSubsequence(Collections.EMPTY_LIST, Collections.EMPTY_LIST); @@ -367,17 +363,17 @@ public class ListUtilsTest { try { ListUtils.longestCommonSubsequence((String) null, null); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} try { ListUtils.longestCommonSubsequence("A", null); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} try { ListUtils.longestCommonSubsequence(null, "A"); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} String lcs = ListUtils.longestCommonSubsequence("", ""); assertEquals(0, lcs.length()); @@ -416,7 +412,7 @@ public class ListUtilsTest { try { ListUtils.partition(null, 3); fail("failed to check for null argument"); - } catch (final IllegalArgumentException e) {} + } catch (final NullPointerException e) {} try { ListUtils.partition(strings, 0); Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java?rev=1686855&r1=1686854&r2=1686855&view=diff ============================================================================== --- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java (original) +++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/MapUtilsTest.java Mon Jun 22 13:00:27 2015 @@ -16,25 +16,21 @@ */ package org.apache.commons.collections4; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.Assert.*; import java.io.ByteArrayOutputStream; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.List; import java.util.ListResourceBundle; import java.util.Map; import java.util.ResourceBundle; import java.util.Set; import java.util.TreeMap; -import java.util.List; -import java.util.ArrayList; import org.apache.commons.collections4.collection.TransformedCollectionTest; import org.apache.commons.collections4.keyvalue.DefaultKeyValue; @@ -68,8 +64,8 @@ public class MapUtilsTest { assertTrue("returned object should be a PredicatedMap", map instanceof PredicatedMap); try { MapUtils.predicatedMap(null, p, p); - fail("Expecting IllegalArgumentException for null map."); - } catch (final IllegalArgumentException e) { + fail("Expecting NullPointerException for null map."); + } catch (final NullPointerException e) { // expected } } @@ -81,14 +77,14 @@ public class MapUtilsTest { assertTrue(map instanceof LazyMap); try { map = MapUtils.lazyMap(new HashMap<Object, Object>(), (Factory<Object>) null); - fail("Expecting IllegalArgumentException for null factory"); - } catch (final IllegalArgumentException e) { + fail("Expecting NullPointerException for null factory"); + } catch (final NullPointerException e) { // expected } try { map = MapUtils.lazyMap((Map<Object, Object>) null, factory); - fail("Expecting IllegalArgumentException for null map"); - } catch (final IllegalArgumentException e) { + fail("Expecting NullPointerException for null map"); + } catch (final NullPointerException e) { // expected } final Transformer<Object, Integer> transformer = TransformerUtils.asTransformer(factory); @@ -96,14 +92,14 @@ public class MapUtilsTest { assertTrue(map instanceof LazyMap); try { map = MapUtils.lazyMap(new HashMap<Object, Object>(), (Transformer<Object, Object>) null); - fail("Expecting IllegalArgumentException for null transformer"); - } catch (final IllegalArgumentException e) { + fail("Expecting NullPointerException for null transformer"); + } catch (final NullPointerException e) { // expected } try { map = MapUtils.lazyMap((Map<Object, Object>) null, transformer); - fail("Expecting IllegalArgumentException for null map"); - } catch (final IllegalArgumentException e) { + fail("Expecting NullPointerException for null map"); + } catch (final NullPointerException e) { // expected } } @@ -859,8 +855,8 @@ public class MapUtilsTest { public void testIterableMap() { try { MapUtils.iterableMap(null); - fail("Should throw IllegalArgumentException"); - } catch (final IllegalArgumentException e) { + fail("Should throw NullPointerException"); + } catch (final NullPointerException e) { } final HashMap<String, String> map = new HashMap<String, String>(); map.put("foo", "foov"); @@ -877,8 +873,8 @@ public class MapUtilsTest { public void testIterableSortedMap() { try { MapUtils.iterableSortedMap(null); - fail("Should throw IllegalArgumentException"); - } catch (final IllegalArgumentException e) { + fail("Should throw NullPointerException"); + } catch (final NullPointerException e) { } final TreeMap<String, String> map = new TreeMap<String, String>(); map.put("foo", "foov");