Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONObject render fields in sorted order with -Dorg.json.fields.sort=true #80

Closed
wants to merge 2 commits into from

Conversation

gmokki
Copy link

@gmokki gmokki commented Apr 1, 2013

The new Java versions(*) randomize the plain HashMap order making the current JSONObject.toString unusable in unit tests or other situations where the output could needs to be in same order on each run.

*) Java8 or Java7 with CVE fix enabling system property (http://docs.oracle.com/javase/7/docs/technotes/guides/collections/changes7.html)

@douglascrockford
Copy link
Contributor

No thank you. JSON ordering is not significant. Making it significant will lead to bugs and interoperability failures.

toString is a lousy way to test.

BGehrels pushed a commit to BGehrels/JSON-java that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants