Instagram / ig-json-parser

Fast JSON parser for java projects
https://instagram-engineering.com/fast-auto-generated-streaming-json-parsing-for-android-ab8e7be21033
MIT License
1.32k stars 124 forks source link

Make processor output deterministic #39

Closed cjhopman closed 7 years ago

cjhopman commented 7 years ago

The processor was creating a HashMap of classes and then iterating over it in order to generate output. This means that the order that output classes were generated is non-deterministic (because Element.hashCode is just Object.hashCode). This then determines the order that the files end up in the jar.

Use a LinkedHashMap instead to get deterministic iteration order.