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

java.util.Arrays.copyOfRange javadoc typo: array[].length, not .length()

XMLWordPrintable

    • b07
    • sparc
    • solaris_10
    • Not verified

      A DESCRIPTION OF THE PROBLEM :
      The javadoc for the family of methods named copyOfRange () of the class java.util.Arrays declares that the method:
          Throws:
              ArrayIndexOutOfBoundsException - if from < 0 or from > original.length()

      This should read:
          Throws:
              ArrayIndexOutOfBoundsException - if from < 0 or from > original.length

      since an array length is a (synthetic) field, not a method.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Throws:
          ArrayIndexOutOfBoundsException - if from < 0 or from > original.length
      ACTUAL -
      Throws:
          ArrayIndexOutOfBoundsException - if from < 0 or from > original.length()

      URL OF FAULTY DOCUMENTATION :
      http://java.sun.com/javase/6/docs/api/java/util/Arrays.html#copyOfRange(double[],%20int,%20int)

            martin Martin Buchholz
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: