-
Bug
-
Resolution: Fixed
-
P4
-
1.4.2
-
b57
-
x86
-
windows_2000
Name: rmT116609 Date: 10/13/2003
A DESCRIPTION OF THE PROBLEM :
When the runtime type of an argument is not a supertype of the runtime type of every element in this Vector, copyInto method of the vector class rightly and justifiably, throws java.lang.ArrayStoreException. BUT the API mentions only NullPointerException in the throws clause.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
copyInto
public void copyInto(Object[] anArray)Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown.
Parameters:
anArray - the array into which the components get copied.
Throws:
NullPointerException - if the given array is null.
ArrayStoreException - if the runtime type of an argument is not a supertype of the runtime type of every element in this Vector.
ACTUAL -
copyInto
public void copyInto(Object[] anArray)Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown.
Parameters:
anArray - the array into which the components get copied.
Throws:
NullPointerException - if the given array is null.
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html#copyInto(java.lang.Object[])
(Incident Review ID: 214644)
======================================================================
A DESCRIPTION OF THE PROBLEM :
When the runtime type of an argument is not a supertype of the runtime type of every element in this Vector, copyInto method of the vector class rightly and justifiably, throws java.lang.ArrayStoreException. BUT the API mentions only NullPointerException in the throws clause.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
copyInto
public void copyInto(Object[] anArray)Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown.
Parameters:
anArray - the array into which the components get copied.
Throws:
NullPointerException - if the given array is null.
ArrayStoreException - if the runtime type of an argument is not a supertype of the runtime type of every element in this Vector.
ACTUAL -
copyInto
public void copyInto(Object[] anArray)Copies the components of this vector into the specified array. The item at index k in this vector is copied into component k of anArray. The array must be big enough to hold all the objects in this vector, else an IndexOutOfBoundsException is thrown.
Parameters:
anArray - the array into which the components get copied.
Throws:
NullPointerException - if the given array is null.
URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html#copyInto(java.lang.Object[])
(Incident Review ID: 214644)
======================================================================