Bug 957131 - hawtjni: depends on field order reported through reflection
Summary: hawtjni: depends on field order reported through reflection
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: hawtjni
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mikolaj Izdebski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 957130 1009417
TreeView+ depends on / blocked
 
Reported: 2013-04-26 12:21 UTC by Florian Weimer
Modified: 2013-09-26 04:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1009417 (view as bug list)
Environment:
Last Closed: 2013-09-26 04:53:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2013-04-26 12:21:11 UTC
The StructsGenerator class assumes that the field order reported through reflection is the source code order.  But the Java API explicitly states that

"The elements in the array returned are not sorted and are not in any particular order."

http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getDeclaredFields%28%29

The fix is to write an annotation processor (which, when running on source code, receives the fields in source code order), or inspect the class file, require debugging information, and sort the fields by line number.

Comment 1 Mikolaj Izdebski 2013-04-26 12:52:03 UTC
Reported upstream: https://github.com/fusesource/hawtjni/issues/6

Comment 2 Fedora End Of Life 2013-09-16 16:40:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 3 Mikolaj Izdebski 2013-09-26 04:53:13 UTC
It looks like generated code does not really depend on field order.
Both upstream and original reporter confirm that.
Closing as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.