Name: rmT116609 Date: 03/27/2003
A DESCRIPTION OF THE PROBLEM :
Inside "toArray" method explanation exists an example that has a bug.
http://java.sun.com/j2se/1.4/docs/api/java/util/Collection.html#toArray(java.lang.Object[])
Presently, it is documented like:
...
Suppose l is a List known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:
String[] x = (String[]) v.toArray(new String[0]);
...
It should be:
...
Suppose l is a List known to contain only strings. The following code can be used to dump the list into a newly allocated array of String:
String[] x = (String[]) l.toArray(new String[0]);
...
(Review ID: 183130)
======================================================================
- duplicates
-
JDK-4297309 Variable name in code snippet doesn't match name in preceding textIn thi
-
- Closed
-
-
JDK-6258264 (coll spec) Minor typo in javadoc of java.util.Collection.toArray(Object[])
-
- Closed
-