-
Bug
-
Resolution: Not an Issue
-
P4
-
1.4.0
-
generic
-
generic
Name: rmT116609 Date: 03/17/2002
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
A DESCRIPTION OF THE PROBLEM :
This typo is present in all versions of J2SE since reflection package is added.
The documentation for following method has a example code. The declaration for the integer argument 'x' should have been just "int" rather than "int[]".
int[] x = {length};
Array.newInstance(componentType, x);
The method accepts only integers. But the sample code given shows an integer array being passed to the method.
There is another newInstance() method that accepts an integer array.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open Java Doc for java.lang.reflect.Array
2. Check the java doc for newInstance(Class componentType, int length) method.
http://java.sun.com/j2se/1.4/docs/api/java/lang/reflect/Array.html#newInstance(java.lang.Class, int)
3. Read the method comment.
(Review ID: 144278)
======================================================================
FULL PRODUCT VERSION :
java version "1.4.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
A DESCRIPTION OF THE PROBLEM :
This typo is present in all versions of J2SE since reflection package is added.
The documentation for following method has a example code. The declaration for the integer argument 'x' should have been just "int" rather than "int[]".
int[] x = {length};
Array.newInstance(componentType, x);
The method accepts only integers. But the sample code given shows an integer array being passed to the method.
There is another newInstance() method that accepts an integer array.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Open Java Doc for java.lang.reflect.Array
2. Check the java doc for newInstance(Class componentType, int length) method.
http://java.sun.com/j2se/1.4/docs/api/java/lang/reflect/Array.html#newInstance(java.lang.Class, int)
3. Read the method comment.
(Review ID: 144278)
======================================================================