[
https://issues.apache.org/jira/browse/AVRO-906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Doug Cutting updated AVRO-906:
------------------------------
Attachment: AVRO-906.patch
Here's a patch that fixes this, including a test.
Note however that it's not a good practice to rely on ordering in JSON objects,
since the specification does not guarantee it.
> Inconsistent ordering of field props
> -------------------------------------
>
> Key: AVRO-906
> URL: https://issues.apache.org/jira/browse/AVRO-906
> Project: Avro
> Issue Type: Bug
> Components: java
> Reporter: Douglas Kaminsky
> Fix For: 1.6.0
>
> Attachments: AVRO-906.patch, PTest.java
>
>
> When a schema/protocol is written and read back in (see attached example) via
> Protocol.parse, the field ordering is not guaranteed to be preserved because
> the "Props" object extends HashMap, which has no ordering contract.
> Recommend switching to a Map implementation with an ordering guarantee.
> (Identified in Avro 1.5.1 - please verify against 1.5.4)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira