Closed arkban closed 1 month ago
Apologies for the years long reaction to this. The project was in a bit of hiatus. Thanks for the PR, but important is this ordering? There is no expectation in JSON spec to have properties be ordered. LinkedHashMap has an obvious overhead, both in terms of memory and time for maintaining the linkage.
I will reject the PR because it is possible to customize the library and get this behavior without changing the main codebase. You can extend Json.Factory to provide your own JSON object implementation and then plug in through the Json.setGlobaFactory
method.
Updated
HashMap
usages to useLinkedHashMap
to preserve order of key insertion in Objects.AFAIK this is not part of the spec yet makes the behavior consistent with other JSON parsers: 1 2 3 4