{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/fastjson/issues/359","labels_url":"https://api.github.com/repos/alibaba/fastjson/issues/359/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/fastjson/issues/359/comments","events_url":"https://api.github.com/repos/alibaba/fastjson/issues/359/events","html_url":"https://github.com/alibaba/fastjson/issues/359","id":90547125,"number":359,"title":"1.2.3版後 JSONObject.toJSONString回傳的字串不再依key值排序了","user":{"login":"limhi","id":3804627,"avatar_url":"https://avatars.githubusercontent.com/u/3804627?v=3","gravatar_id":"","url":"https://api.github.com/users/limhi","html_url":"https://github.com/limhi","followers_url":"https://api.github.com/users/limhi/followers","following_url":"https://api.github.com/users/limhi/following{/other_user}","gists_url":"https://api.github.com/users/limhi/gists{/gist_id}","starred_url":"https://api.github.com/users/limhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/limhi/subscriptions","organizations_url":"https://api.github.com/users/limhi/orgs","repos_url":"https://api.github.com/users/limhi/repos","events_url":"https://api.github.com/users/limhi/events{/privacy}","received_events_url":"https://api.github.com/users/limhi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-24T02:46:18Z","updated_at":"2015-06-24T09:19:13Z","closed_at":null,"body":"即便使用了 SerializerFeature.SortField 亦得到錯誤結果\r\n測試程式：\r\n```\r\nString str = \"{\\\"Format\\\":\\\"json\\\",\\\"Name\\\":\\\"wwqqzz\\\",\\\"Para\\\":{\\\"myuser\\\":333,\\\"mynum\\\":\\\"222\\\", \\\"mylist\\\":[11,55,\\\"33\\\"]},\\\"Reserved\\\":{},\\\"Type\\\":\\\"request\\\",\\\"Version\\\":\\\"1.0\\\"}\";\r\nSystem.out.println(\"str = \\t\\t\" + str);\r\n\r\nJSONObject json = JSONObject.parseObject(str);\r\n\r\nSystem.out.println(\"0.0 json  = \\t\" + JSONObject.toJSONString(json));\r\nSystem.out.println(\"0.1 json  = \\t\" + JSONObject.toJSONString(json, SerializerFeature.SortField));\r\n```\r\n\r\n使用1.2.2版時輸出 => 正常\r\n```\r\nstr = \t\t{\"Format\":\"json\",\"Name\":\"wwqqzz\",\"Para\":{\"myuser\":333,\"mynum\":\"222\", \"mylist\":[11,55,\"33\"]},\"Reserved\":{},\"Type\":\"request\",\"Version\":\"1.0\"}\r\n0.0 json  = \t{\"Format\":\"json\",\"Name\":\"wwqqzz\",\"Para\":{\"mylist\":[11,55,\"33\"],\"mynum\":\"222\",\"myuser\":333},\"Reserved\":{},\"Type\":\"request\",\"Version\":\"1.0\"}\r\n0.1 json  = \t{\"Format\":\"json\",\"Name\":\"wwqqzz\",\"Para\":{\"mylist\":[11,55,\"33\"],\"mynum\":\"222\",\"myuser\":333},\"Reserved\":{},\"Type\":\"request\",\"Version\":\"1.0\"}\r\n```\r\n\r\n使用1.2.3~1.2.6版時輸出 => 亂序\r\n```\r\nstr = \t\t{\"Format\":\"json\",\"Name\":\"wwqqzz\",\"Para\":{\"myuser\":333,\"mynum\":\"222\", \"mylist\":[11,55,\"33\"]},\"Reserved\":{},\"Type\":\"request\",\"Version\":\"1.0\"}\r\n0.0 json  = \t{\"Type\":\"request\",\"Format\":\"json\",\"Para\":{\"mynum\":\"222\",\"mylist\":[11,55,\"33\"],\"myuser\":333},\"Version\":\"1.0\",\"Name\":\"wwqqzz\",\"Reserved\":{}}\r\n0.1 json  = \t{\"Type\":\"request\",\"Format\":\"json\",\"Para\":{\"mynum\":\"222\",\"mylist\":[11,55,\"33\"],\"myuser\":333},\"Version\":\"1.0\",\"Name\":\"wwqqzz\",\"Reserved\":{}}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/alibaba/fastjson/issues/comments/114800463","html_url":"https://github.com/alibaba/fastjson/issues/359#issuecomment-114800463","issue_url":"https://api.github.com/repos/alibaba/fastjson/issues/359","id":114800463,"user":{"login":"FkinH","id":12364690,"avatar_url":"https://avatars.githubusercontent.com/u/12364690?v=3","gravatar_id":"","url":"https://api.github.com/users/FkinH","html_url":"https://github.com/FkinH","followers_url":"https://api.github.com/users/FkinH/followers","following_url":"https://api.github.com/users/FkinH/following{/other_user}","gists_url":"https://api.github.com/users/FkinH/gists{/gist_id}","starred_url":"https://api.github.com/users/FkinH/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FkinH/subscriptions","organizations_url":"https://api.github.com/users/FkinH/orgs","repos_url":"https://api.github.com/users/FkinH/repos","events_url":"https://api.github.com/users/FkinH/events{/privacy}","received_events_url":"https://api.github.com/users/FkinH/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T09:19:13Z","updated_at":"2015-06-24T09:19:13Z","body":"try this.\r\n```\r\n@JSONType(orders = {})\r\n```"}}