-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
1.4.0
-
x86
-
windows_2000
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
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
- relates to
-
JDK-4210339 Let Class.getFields() return an ORDERED list of fields
- Closed