There seems to be no way to get an array Class from another Class.

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Not an Issue
    • Priority: P5
    • None
    • Affects Version/s: 1.1, 1.1.5
    • Component/s: core-libs
    • generic, sparc
    • generic, solaris_2.5.1



      Name: mc57594 Date: 02/11/97


      The problem is very simple: When one is working with the Core Reflection API, it is sometimes useful to be able to go from an arbitrary Class A to the Class representing an array of Class A. This is the sort of code I need to be able to write:

      Object gimmeAnArray (Class cls, int size)
      {
        Class arrayCls = cls.getArrayClass (); // this is what I can't currently do
        return arrayCls.newInstance (size);
      }

      company - Electric Communities , email - ###@###.###
      ======================================================================

            Assignee:
            Tom Rodriguez
            Reporter:
            Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: