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

(reflect) Class.forName and Array.newInstance are inconsistent regarding multidimensional arrays

    XMLWordPrintable

Details

    • b113
    • generic
    • generic
    • Verified

    Description

      There are two issues with the method Class.forName:
      1. Class.forName specification doesn't mention any resrtiction concerning array dimensions. Currently the implementation throws ClassNotFoundException if the given name of desired class represents the array which dimension is >255.
      2. The behavior of the method Array.newInstance is inconsistent with the method Class.forName. While it's prohibited to create Class objects which reflect arrays with dimension >255 using Class.forName, it is possible to create arrays with almost any dimension using Array.newInstance.

      Attachments

        Activity

          People

            jfranck Joel Borggrén-Franck (Inactive)
            dmiltsov Dmitry Miltsov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: