j256 / ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
http://ormlite.com/
ISC License
1.59k stars 367 forks source link

Make config file generation deterministic #74

Closed jibidus closed 6 years ago

jibidus commented 8 years ago

Improve ormlite_config.txt generation with deterministic processing order of annotated class. This will prevent random ormlite_config.txt modification even if annotated classes has not changed.

This was due to File.listFiles() which does not guaranty any specific order (see javadoc) :

There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.

I would have liked to create some tests, but OrmLiteConfigUtil is not very test friendly. If you know how I can test this, feel free to answer.

j256 commented 6 years ago

Thanks for this dude. I ended up solving it a different way. See: https://github.com/j256/ormlite-android/commit/d1cd7ba751dff7ebb3bcadac2af811cb5c979b28