Details
Description
Consistent ordering ( for example alphabetic ) is important for
unit testing by generama testcases.
current HashMaps do not provide consistent ordering between different java vesrsions - this leads to failing builds.
Possible solution would be to change HashMaps to TreeMaps -> alphabetical ordering.
While it is possible to perform sorting on client side ( in plugins etc. ) , this will be less work to fix it in qdox...
Patches to follow if accepted
Activity
Konstantin Pribluda
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | qdox.patch [ 12433 ] |
Mike Williams
made changes -
Assignee | Mike Williams [ mdub ] |
Mike Williams
made changes -
Summary | Provide consistent ordering on class propeties , methods and members | Provide consistent ordering for JavaClass.getBeanProperties |
Affects Version/s | 1.5 [ 10650 ] | |
Affects Version/s | 1.6 [ 10814 ] | |
Fix Version/s | 1.6 [ 10814 ] |
Mike Williams
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Mike Williams
made changes -
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Mike Williams
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
I agree, ordering of collections should be consistent across JDKs, and across runs of QDox. IMHO source elements should be listed in the order they were declared in the original source.
I thought this was largely the case already, actually; in most cases, we maintain ordered lists of elements, append to the end while parsing the source, and make them available as arrays in the API.
Obviously, there must be cases where this is not true (or you wouldn't have raised this issue). Konstanstin, can you provided specific examples of calls that return Collections/Maps with inconsistent ordering? Thanks.