Retain sort order if object is an instance of SortedMap by uklimaschewski · Pull Request #91 · stleary/JSON-java · GitHub
Skip to content

Retain sort order if object is an instance of SortedMap#91

Closed
uklimaschewski wants to merge 1 commit into
stleary:masterfrom
uklimaschewski:master
Closed

Retain sort order if object is an instance of SortedMap#91
uklimaschewski wants to merge 1 commit into
stleary:masterfrom
uklimaschewski:master

Conversation

@uklimaschewski

Copy link
Copy Markdown

Retain the original sort order, if converting from a SortedMap instance

@douglascrockford

Copy link
Copy Markdown
Contributor

@uklimaschewski

Copy link
Copy Markdown
Author

This pull request does not "fix" the order, it retains the order of already sorted maps. It indroduces in no way interoperability problems.

@douglascrockford

Copy link
Copy Markdown
Contributor

If a consumer assumes a particular order, then you have introduced an interoperability hazard. Consumers will only assume such an order if you guarantee such an order.

@uklimaschewski

Copy link
Copy Markdown
Author

If the consumer does not assume a particular order, then it does not matter to him if there is a particular order or not. So there is no interoperability hazard, because this pull request is not the consumer.

@ghost

ghost commented Feb 24, 2014

Copy link
Copy Markdown

I agree with uklimaschewski. Keeping the order does not contradict that the order "may" change.

@douglascrockford

Copy link
Copy Markdown
Contributor

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