More IllegalArgument checks to decorators.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130792 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
pjack 2002-08-17 21:10:46 +00:00
parent db484419cb
commit a24ad64d19
5 changed files with 57 additions and 18 deletions

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BagUtils.java,v 1.3 2002/08/13 00:49:59 pjack Exp $
* $Revision: 1.3 $
* $Date: 2002/08/13 00:49:59 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/BagUtils.java,v 1.4 2002/08/17 21:10:46 pjack Exp $
* $Revision: 1.4 $
* $Date: 2002/08/17 21:10:46 $
*
* ====================================================================
*
@ -71,7 +71,7 @@ import java.util.Set;
* and {@link SortedBag} instances.<P>
*
* @author Paul Jack
* @version $Id: BagUtils.java,v 1.3 2002/08/13 00:49:59 pjack Exp $
* @version $Id: BagUtils.java,v 1.4 2002/08/17 21:10:46 pjack Exp $
* @since 2.1
*/
public class BagUtils {
@ -182,6 +182,9 @@ public class BagUtils {
public BoundedBag(Bag bag, int maxSize) {
super(bag);
if (maxSize < 0) {
throw new IllegalArgumentException("maxSize must be nonnegative.");
}
this.maxSize = maxSize;
}

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CollectionUtils.java,v 1.12 2002/08/17 11:38:35 scolebourne Exp $
* $Revision: 1.12 $
* $Date: 2002/08/17 11:38:35 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/CollectionUtils.java,v 1.13 2002/08/17 21:10:46 pjack Exp $
* $Revision: 1.13 $
* $Date: 2002/08/17 21:10:46 $
*
* ====================================================================
*
@ -81,7 +81,7 @@ import org.apache.commons.collections.iterators.EnumerationIterator;
* @author Rodney Waldhoff
*
* @since 1.0
* @version $Id: CollectionUtils.java,v 1.12 2002/08/17 11:38:35 scolebourne Exp $
* @version $Id: CollectionUtils.java,v 1.13 2002/08/17 21:10:46 pjack Exp $
*/
public class CollectionUtils {
@ -753,6 +753,9 @@ public class CollectionUtils {
public BoundedCollection(Collection c, int maxSize) {
super(c);
if (maxSize < 0) {
throw new IllegalArgumentException("maxSize must be nonnegative.");
}
this.maxSize = maxSize;
}

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ListUtils.java,v 1.8 2002/08/15 20:09:37 pjack Exp $
* $Revision: 1.8 $
* $Date: 2002/08/15 20:09:37 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/ListUtils.java,v 1.9 2002/08/17 21:10:46 pjack Exp $
* $Revision: 1.9 $
* $Date: 2002/08/17 21:10:46 $
*
* ====================================================================
*
@ -364,6 +364,9 @@ public class ListUtils
public BoundedList(List list, int maxSize) {
super(list);
if (maxSize < 0) {
throw new IllegalArgumentException("maxSize must be nonnegative.");
}
this.maxSize = maxSize;
}
@ -444,6 +447,9 @@ public class ListUtils
public LazyList(List list, Factory factory) {
super(list);
if (factory == null) {
throw new IllegalArgumentException("factory may not be null");
}
this.factory = factory;
}

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapUtils.java,v 1.9 2002/08/15 20:09:37 pjack Exp $
* $Revision: 1.9 $
* $Date: 2002/08/15 20:09:37 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/MapUtils.java,v 1.10 2002/08/17 21:10:46 pjack Exp $
* $Revision: 1.10 $
* $Date: 2002/08/17 21:10:46 $
*
* ====================================================================
*
@ -736,6 +736,15 @@ public class MapUtils {
public PredicatedMap(Map map, Predicate keyPred, Predicate valuePred) {
super(map);
if (map == null) {
throw new IllegalArgumentException("map may not be null.");
}
if (keyPred == null) {
throw new IllegalArgumentException("keyPred may not be null.");
}
if (valuePred == null) {
throw new IllegalArgumentException("valuePred may not be null.");
}
this.keyPredicate = keyPred;
this.valuePredicate = valuePred;
Iterator iter = map.entrySet().iterator();
@ -856,6 +865,12 @@ public class MapUtils {
public BoundedMap(Map map, int maxSize) {
super(map);
if (map == null) {
throw new IllegalArgumentException("map may not be null.");
}
if (maxSize < 0) {
throw new IllegalArgumentException("maxSize must be nonnegative.");
}
this.maxSize = maxSize;
}
@ -886,6 +901,9 @@ public class MapUtils {
public FixedSizeMap(Map map) {
super(map);
if (map == null) {
throw new IllegalArgumentException("map may not be null.");
}
}
@ -916,6 +934,12 @@ public class MapUtils {
public LazyMap(Map map, Factory factory) {
super(map);
if (map == null) {
throw new IllegalArgumentException("map may not be null.");
}
if (factory == null) {
throw new IllegalArgumentException("factory may not be null.");
}
this.factory = factory;
}

View File

@ -1,7 +1,7 @@
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/SetUtils.java,v 1.3 2002/08/13 00:49:59 pjack Exp $
* $Revision: 1.3 $
* $Date: 2002/08/13 00:49:59 $
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/SetUtils.java,v 1.4 2002/08/17 21:10:46 pjack Exp $
* $Revision: 1.4 $
* $Date: 2002/08/17 21:10:46 $
*
* ====================================================================
*
@ -73,7 +73,7 @@ import java.util.SortedSet;
* and {@link SortedSet} instances.
*
* @author Paul Jack
* @version $Id: SetUtils.java,v 1.3 2002/08/13 00:49:59 pjack Exp $
* @version $Id: SetUtils.java,v 1.4 2002/08/17 21:10:46 pjack Exp $
* @since 2.1
*/
public class SetUtils {
@ -103,6 +103,9 @@ public class SetUtils {
public BoundedSet(Set set, int maxSize) {
super(set);
if (maxSize < 0) {
throw new IllegalArgumentException("maxSize must be nonnegative.");
}
this.maxSize = maxSize;
}