Use SortedDictionary in System.Json.JsonObject
authorSteffen Kieß <Steffen.Kiess@ipvs.uni-stuttgart.de>
Fri, 11 Jul 2014 14:04:42 +0000 (16:04 +0200)
committerSteffen Kieß <Steffen.Kiess@ipvs.uni-stuttgart.de>
Fri, 11 Jul 2014 14:13:41 +0000 (16:13 +0200)
commitd65e93b74fd5623881e561dd0be240003a7d6c54
treed22098b914851f5ae67b1485edfa853cb792c17a
parent1a021c1e79f2b3413813f11c7ca88068cf72eecb
Use SortedDictionary in System.Json.JsonObject

Currently JsonObject uses a Dictionary and JsonValue does not sort the keys
in SaveInternal(). As iterating over a Dictionary returns the values in
random order, this causes the JSON string to be non-deterministic.
Switching to SortedDictionary makes sure that the same object always will
produce the same JSON string.
The keys are sorted using StringComparer.Ordinal to produce the same order
in all locales.
mcs/class/System.Json/System.Json/JsonObject.cs
mcs/class/System.Json/Test/System.Json/JsonValueTest.cs