diff --git a/src/java/org/apache/commons/collections/primitives/FloatArrayList.java b/src/java/org/apache/commons/collections/primitives/FloatArrayList.java index 76f6799a8..7cfa0b703 100644 --- a/src/java/org/apache/commons/collections/primitives/FloatArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/FloatArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatArrayList.java,v 1.4 2002/08/23 17:31:28 pjack Exp $ - * $Revision: 1.4 $ - * $Date: 2002/08/23 17:31:28 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/FloatArrayList.java,v 1.5 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.5 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -78,7 +78,7 @@ import java.util.ListIterator; * {@link java.util.ArrayList} of {@link Float} values and allows for * better compile-time type checking.
* - * @version $Revision: 1.4 $ $Date: 2002/08/23 17:31:28 $ + * @version $Revision: 1.5 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class FloatArrayList extends AbstractList implements List, Serializable { @@ -98,11 +98,10 @@ public class FloatArrayList extends AbstractList implements List, Serializable { * capacity. * * @param capacity the initial capacity for the list - * @throws IllegalArgumentException if capacity is less than or equal - * to zero + * @throws IllegalArgumentException if capacity is less than zero */ public FloatArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new float[capacity]; diff --git a/src/java/org/apache/commons/collections/primitives/IntArrayList.java b/src/java/org/apache/commons/collections/primitives/IntArrayList.java index 3d741960a..709d299ee 100644 --- a/src/java/org/apache/commons/collections/primitives/IntArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/IntArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $ - * $Revision: 1.5 $ - * $Date: 2002/08/22 01:50:54 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/IntArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.6 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -78,7 +78,7 @@ import java.util.ListIterator; * {@link java.util.ArrayList} of {@link Integer} values and allows for * better compile-time type checking.
*
- * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $
+ * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $
* @author Rodney Waldhoff
*/
public class IntArrayList extends AbstractIntArrayList implements Serializable {
@@ -96,11 +96,10 @@ public class IntArrayList extends AbstractIntArrayList implements Serializable {
* Constructs a new IntArrayList
with the given capacity.
*
* @param the capacity for the list
- * @throws IllegalArgumentException if the capacity is less than or
- * equal to zero
+ * @throws IllegalArgumentException if the capacity is less than zero
*/
public IntArrayList(int capacity) {
- if (capacity <= 0) {
+ if (capacity < 0) {
throw new IllegalArgumentException("capacity " + capacity);
}
_data = new int[capacity];
diff --git a/src/java/org/apache/commons/collections/primitives/LongArrayList.java b/src/java/org/apache/commons/collections/primitives/LongArrayList.java
index 5c8be0ca6..5af28a136 100644
--- a/src/java/org/apache/commons/collections/primitives/LongArrayList.java
+++ b/src/java/org/apache/commons/collections/primitives/LongArrayList.java
@@ -1,7 +1,7 @@
/*
- * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $
- * $Revision: 1.5 $
- * $Date: 2002/08/22 01:50:54 $
+ * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/LongArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $
+ * $Revision: 1.6 $
+ * $Date: 2002/09/07 20:33:32 $
*
* ====================================================================
*
@@ -78,7 +78,7 @@ import java.util.ListIterator;
* {@link java.util.ArrayList} of {@link Long} values and allows for
* better compile-time type checking.
* - * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $ + * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class LongArrayList extends AbstractLongArrayList implements Serializable { @@ -98,11 +98,10 @@ public class LongArrayList extends AbstractLongArrayList implements Serializable * capacity. * * @param capacity the initial capacity for the array - * @throws IllegalArgumentException if the capacity is less than or - * equal to zero + * @throws IllegalArgumentException if the capacity is less than zero */ public LongArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new long[capacity]; diff --git a/src/java/org/apache/commons/collections/primitives/ShortArrayList.java b/src/java/org/apache/commons/collections/primitives/ShortArrayList.java index c495015ba..283de430c 100644 --- a/src/java/org/apache/commons/collections/primitives/ShortArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/ShortArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $ - * $Revision: 1.5 $ - * $Date: 2002/08/22 01:50:54 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/ShortArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.6 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -78,7 +78,7 @@ import java.util.ListIterator; * {@link java.util.ArrayList} of {@link Short} values and allows for * better compile-time type checking.
* - * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $ + * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class ShortArrayList extends AbstractShortArrayList implements Serializable { @@ -98,11 +98,10 @@ public class ShortArrayList extends AbstractShortArrayList implements Serializab * capacity. * * @param capacity the initial capacity for the array - * @throws IllegalArgumentException if the capacity is less than or - * equal to zero + * @throws IllegalArgumentException if the capacity is less than zero */ public ShortArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new short[capacity]; diff --git a/src/java/org/apache/commons/collections/primitives/UnsignedByteArrayList.java b/src/java/org/apache/commons/collections/primitives/UnsignedByteArrayList.java index 590f66541..6dd1a5e0d 100644 --- a/src/java/org/apache/commons/collections/primitives/UnsignedByteArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/UnsignedByteArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedByteArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $ - * $Revision: 1.5 $ - * $Date: 2002/08/22 01:50:54 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedByteArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.6 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -80,7 +80,7 @@ import java.util.ListIterator; * than a {@link java.util.ArrayList} and offers better compile-time type * checking. * - * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $ + * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class UnsignedByteArrayList extends AbstractShortArrayList implements Serializable { @@ -100,11 +100,10 @@ public class UnsignedByteArrayList extends AbstractShortArrayList implements Ser * specified initial capacity. * * @param capacity the capacity for this list - * @throws IllegalArgumentException if the given capacity is less than - * or equal to zero + * @throws IllegalArgumentException if the given capacity is less than zero */ public UnsignedByteArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new byte[capacity]; @@ -174,26 +173,26 @@ public class UnsignedByteArrayList extends AbstractShortArrayList implements Ser checkRangeIncludingEndpoint(index); ensureCapacity(_size+1); int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromShort(value); - _size++; + System.arraycopy(_data,index,_data,index+1,numtomove); + _data[index] = fromShort(value); + _size++; } public void clear() { - modCount++; + modCount++; _size = 0; } public short removeShortAt(int index) { checkRange(index); - modCount++; + modCount++; short oldval = toShort(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); + int numtomove = _size - index - 1; + if(numtomove > 0) { + System.arraycopy(_data,index+1,_data,index,numtomove); } _size--; - return oldval; + return oldval; } public boolean removeShort(short value) { @@ -208,22 +207,22 @@ public class UnsignedByteArrayList extends AbstractShortArrayList implements Ser } public void ensureCapacity(int mincap) { - modCount++; - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - byte[] olddata = _data; - _data = new byte[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(mincap > _data.length) { + int newcap = (_data.length * 3)/2 + 1; + byte[] olddata = _data; + _data = new byte[newcap < mincap ? mincap : newcap]; + System.arraycopy(olddata,0,_data,0,_size); + } } public void trimToSize() { - modCount++; - if(_size < _data.length) { - byte[] olddata = _data; - _data = new byte[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(_size < _data.length) { + byte[] olddata = _data; + _data = new byte[_size]; + System.arraycopy(olddata,0,_data,0,_size); + } } //--------------------------------------------------------------- @@ -246,17 +245,17 @@ public class UnsignedByteArrayList extends AbstractShortArrayList implements Ser } private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); + out.defaultWriteObject(); out.writeInt(_data.length); - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { out.writeByte(_data[i]); } } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); + in.defaultReadObject(); _data = new byte[in.readInt()]; - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { _data[i] = in.readByte(); } } diff --git a/src/java/org/apache/commons/collections/primitives/UnsignedIntArrayList.java b/src/java/org/apache/commons/collections/primitives/UnsignedIntArrayList.java index 1722517e6..e514680e4 100644 --- a/src/java/org/apache/commons/collections/primitives/UnsignedIntArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/UnsignedIntArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedIntArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $ - * $Revision: 1.5 $ - * $Date: 2002/08/22 01:50:54 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedIntArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.6 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -80,7 +80,7 @@ import java.util.ListIterator; * than a {@link java.util.ArrayList} and offers better compile-time type * checking. * - * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $ + * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class UnsignedIntArrayList extends AbstractLongArrayList implements Serializable { @@ -100,11 +100,10 @@ public class UnsignedIntArrayList extends AbstractLongArrayList implements Seria * specified initial capacity. * * @param capacity the capacity for this list - * @throws IllegalArgumentException if the given capacity is less than - * or equal to zero + * @throws IllegalArgumentException if the given capacity is less than zero */ public UnsignedIntArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new int[capacity]; @@ -174,26 +173,26 @@ public class UnsignedIntArrayList extends AbstractLongArrayList implements Seria checkRangeIncludingEndpoint(index); ensureCapacity(_size+1); int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromLong(value); - _size++; + System.arraycopy(_data,index,_data,index+1,numtomove); + _data[index] = fromLong(value); + _size++; } public void clear() { - modCount++; + modCount++; _size = 0; } public long removeLongAt(int index) { checkRange(index); - modCount++; + modCount++; long oldval = toLong(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); + int numtomove = _size - index - 1; + if(numtomove > 0) { + System.arraycopy(_data,index+1,_data,index,numtomove); } _size--; - return oldval; + return oldval; } public boolean removeLong(long value) { @@ -208,22 +207,22 @@ public class UnsignedIntArrayList extends AbstractLongArrayList implements Seria } public void ensureCapacity(int mincap) { - modCount++; - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - int[] olddata = _data; - _data = new int[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(mincap > _data.length) { + int newcap = (_data.length * 3)/2 + 1; + int[] olddata = _data; + _data = new int[newcap < mincap ? mincap : newcap]; + System.arraycopy(olddata,0,_data,0,_size); + } } public void trimToSize() { - modCount++; - if(_size < _data.length) { - int[] olddata = _data; - _data = new int[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(_size < _data.length) { + int[] olddata = _data; + _data = new int[_size]; + System.arraycopy(olddata,0,_data,0,_size); + } } //--------------------------------------------------------------- @@ -245,17 +244,17 @@ public class UnsignedIntArrayList extends AbstractLongArrayList implements Seria } } private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); + out.defaultWriteObject(); out.writeInt(_data.length); - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { out.writeInt(_data[i]); } } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); + in.defaultReadObject(); _data = new int[in.readInt()]; - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { _data[i] = in.readInt(); } } diff --git a/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java b/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java index 3ef0dc3b2..80c98d473 100644 --- a/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java +++ b/src/java/org/apache/commons/collections/primitives/UnsignedShortArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedShortArrayList.java,v 1.5 2002/08/22 01:50:54 pjack Exp $ - * $Revision: 1.5 $ - * $Date: 2002/08/22 01:50:54 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/java/org/apache/commons/collections/primitives/Attic/UnsignedShortArrayList.java,v 1.6 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.6 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -80,7 +80,7 @@ import java.util.ListIterator; * than a {@link java.util.ArrayList} and offers better compile-time type * checking. * - * @version $Revision: 1.5 $ $Date: 2002/08/22 01:50:54 $ + * @version $Revision: 1.6 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class UnsignedShortArrayList extends AbstractIntArrayList implements Serializable { @@ -101,11 +101,10 @@ public class UnsignedShortArrayList extends AbstractIntArrayList implements Seri * specified initial capacity. * * @param capacity the capacity for this list - * @throws IllegalArgumentException if the given capacity is less than - * or equal to zero + * @throws IllegalArgumentException if the given capacity is less than zero */ public UnsignedShortArrayList(int capacity) { - if (capacity <= 0) { + if (capacity < 0) { throw new IllegalArgumentException("capacity=" + capacity); } _data = new short[capacity]; @@ -175,26 +174,26 @@ public class UnsignedShortArrayList extends AbstractIntArrayList implements Seri checkRangeIncludingEndpoint(index); ensureCapacity(_size+1); int numtomove = _size-index; - System.arraycopy(_data,index,_data,index+1,numtomove); - _data[index] = fromInt(value); - _size++; + System.arraycopy(_data,index,_data,index+1,numtomove); + _data[index] = fromInt(value); + _size++; } public void clear() { - modCount++; + modCount++; _size = 0; } public int removeIntAt(int index) { checkRange(index); - modCount++; + modCount++; int oldval = toInt(_data[index]); - int numtomove = _size - index - 1; - if(numtomove > 0) { - System.arraycopy(_data,index+1,_data,index,numtomove); + int numtomove = _size - index - 1; + if(numtomove > 0) { + System.arraycopy(_data,index+1,_data,index,numtomove); } _size--; - return oldval; + return oldval; } public boolean removeInt(int value) { @@ -209,22 +208,22 @@ public class UnsignedShortArrayList extends AbstractIntArrayList implements Seri } public void ensureCapacity(int mincap) { - modCount++; - if(mincap > _data.length) { - int newcap = (_data.length * 3)/2 + 1; - short[] olddata = _data; - _data = new short[newcap < mincap ? mincap : newcap]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(mincap > _data.length) { + int newcap = (_data.length * 3)/2 + 1; + short[] olddata = _data; + _data = new short[newcap < mincap ? mincap : newcap]; + System.arraycopy(olddata,0,_data,0,_size); + } } public void trimToSize() { - modCount++; - if(_size < _data.length) { - short[] olddata = _data; - _data = new short[_size]; - System.arraycopy(olddata,0,_data,0,_size); - } + modCount++; + if(_size < _data.length) { + short[] olddata = _data; + _data = new short[_size]; + System.arraycopy(olddata,0,_data,0,_size); + } } //--------------------------------------------------------------- @@ -247,17 +246,17 @@ public class UnsignedShortArrayList extends AbstractIntArrayList implements Seri } private void writeObject(ObjectOutputStream out) throws IOException{ - out.defaultWriteObject(); + out.defaultWriteObject(); out.writeInt(_data.length); - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { out.writeShort(_data[i]); } } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { - in.defaultReadObject(); + in.defaultReadObject(); _data = new short[in.readInt()]; - for(int i=0;i<_size;i++) { + for(int i=0;i<_size;i++) { _data[i] = in.readShort(); } } diff --git a/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java b/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java index 84b2abdc4..e08a87976 100644 --- a/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestFloatArrayList.java,v 1.2 2002/06/21 04:01:31 mas Exp $ - * $Revision: 1.2 $ - * $Date: 2002/06/21 04:01:31 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestFloatArrayList.java,v 1.3 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.3 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -68,7 +68,7 @@ import org.apache.commons.collections.TestList; import java.util.List; /** - * @version $Revision: 1.2 $ $Date: 2002/06/21 04:01:31 $ + * @version $Revision: 1.3 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestFloatArrayList extends TestList { @@ -98,6 +98,10 @@ public class TestFloatArrayList extends TestList { //------------------------------------------------------------------- Tests + public void testZeroInitialCapacityIsValid() { + FloatArrayList list = new FloatArrayList(0); + } + public void testAddGet() { FloatArrayList list = createList(); for(float i=0F;i<1000F;i++) { diff --git a/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java b/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java index 98fa46f44..141900564 100644 --- a/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestIntArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestIntArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestIntArrayList extends TestAbstractIntArrayList { @@ -89,5 +89,11 @@ public class TestIntArrayList extends TestAbstractIntArrayList { return new IntArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + IntArrayList list = new IntArrayList(0); + } + } diff --git a/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java b/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java index 372da0f5b..47837cff7 100644 --- a/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestLongArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestLongArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestLongArrayList extends TestAbstractLongArrayList { @@ -89,5 +89,11 @@ public class TestLongArrayList extends TestAbstractLongArrayList { return new LongArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + LongArrayList list = new LongArrayList(0); + } + } diff --git a/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java b/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java index a41d81979..46e82befd 100644 --- a/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestShortArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestShortArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestShortArrayList extends TestAbstractShortArrayList { @@ -89,5 +89,11 @@ public class TestShortArrayList extends TestAbstractShortArrayList { return new ShortArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + ShortArrayList list = new ShortArrayList(0); + } + } diff --git a/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java b/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java index 42d1fdcca..c25e9aea0 100644 --- a/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedByteArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedByteArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestUnsignedByteArrayList extends TestAbstractShortArrayList { @@ -89,5 +89,11 @@ public class TestUnsignedByteArrayList extends TestAbstractShortArrayList { return new UnsignedByteArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + UnsignedByteArrayList list = new UnsignedByteArrayList(0); + } + } diff --git a/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java b/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java index bcf661ca8..e3ca464a3 100644 --- a/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedIntArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedIntArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestUnsignedIntArrayList extends TestAbstractLongArrayList { @@ -89,5 +89,11 @@ public class TestUnsignedIntArrayList extends TestAbstractLongArrayList { return new UnsignedIntArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + UnsignedIntArrayList list = new UnsignedIntArrayList(0); + } + } diff --git a/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java b/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java index 7d5509cb7..ff1784ac2 100644 --- a/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java +++ b/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedShortArrayList.java,v 1.3 2002/08/19 21:19:03 pjack Exp $ - * $Revision: 1.3 $ - * $Date: 2002/08/19 21:19:03 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/primitives/Attic/TestUnsignedShortArrayList.java,v 1.4 2002/09/07 20:33:32 rwaldhoff Exp $ + * $Revision: 1.4 $ + * $Date: 2002/09/07 20:33:32 $ * * ==================================================================== * @@ -67,7 +67,7 @@ import junit.framework.TestSuite; import org.apache.commons.collections.BulkTest; /** - * @version $Revision: 1.3 $ $Date: 2002/08/19 21:19:03 $ + * @version $Revision: 1.4 $ $Date: 2002/09/07 20:33:32 $ * @author Rodney Waldhoff */ public class TestUnsignedShortArrayList extends TestAbstractIntArrayList { @@ -89,5 +89,11 @@ public class TestUnsignedShortArrayList extends TestAbstractIntArrayList { return new UnsignedShortArrayList(); } + //---------------------------------------------------------------- Tests + + public void testZeroInitialCapacityIsValid() { + UnsignedShortArrayList list = new UnsignedShortArrayList(0); + } + }