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

(reflect) Need API to create array classes

XMLWordPrintable

    • x86, sparc
    • solaris_2.5, solaris_2.6, windows_95, windows_nt

      An API is needed to be able to create array classes.

      A method can be added to java.lang.Class:

         public Class getArrayType(int dimensions);

      It would return a Class class for the array of that class with the
      appropriate number of dimensions. If applied to an Array class
      it would return a Class an array with a number of dimensions
      equal to the existing array class plus the dimensions specified.
      If applied to any of the primitive types it should create the
      appropriately typed array.

      This method is a campanion to Class.getComponentType.

      Related methods for reflecting upon arrays in in java.lang.reflect.Array.

            darcy Joe Darcy
            rriggs Roger Riggs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: