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

(reflect) Class.getFields() returns data differently in 1.3 and 1.4

XMLWordPrintable

      In jdk1.3 and lower Class.getFields returns data in one order and jdk1.4
      represents it in another. Customer is using the getFields () call to get all the
      public fields in a class (and its superclasses).

      jdk1.3 and lower returns superclass fields,subclass fields
      In jdk1.4 the order is reversed. They get subclass fields, superclass fields

      What would be nice is if there was a way to return the natural order of the
      fields from a class independant of the way Java needs to represent the
      fields internally.

      The other solution ofcourse is for applications not to depend on any
      ordering, but impose an ordering on the fields, by refering to some other
      template. The customer would loose some flexibility here, in that there needs
      to be a double definition of the fields, one in the class and another in the
      template, but in the absence of any garantee from our JDK there is no other
      choice at present.

      Also see bug id 4210339

            iris Iris Clark
            atongschsunw Albert Tong-schmidt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: