Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4297309

Variable name in code snippet doesn't match name in preceding textIn thi

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • core-libs
    • None
    • generic
    • generic

      This API documentation:

      http://java.sun.com/products/jdk/1.2/docs/api/java/util/Collection.html#toArray(java.lang.Object[])

      contains this text and code:

      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]);

      Note that the List is called l in the prose and v in the code. The variable names should match.

            martin Martin Buchholz
            jjb Josh Bloch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: