@Test
public void test() {
String s1 = "{\"fund_bill_list\":[{\"amount\":\"10.26\",\"fund_channel\":\"ALIPAYACCOUNT\"},{\"amount\":\"1.24\",\"fund_channel\":\"DISCOUNT\",\"real_amount\":\"0.00\"}],\"invoice_amount\":\"10.26\",\"total_amount\":\"11.50\",\"trade_no\":\"2017080421001004040273206391\",\"trade_status\":\"TRADE_SUCCESS\"}";
JSONObject o = JSONObject.parseObject(s1);
System.out.println(o.getString("fund_bill_list"));
}
同样一段代码,使用JDK7和JDK8分别运行的结果不一致
使用JDK7运行结果:[{"amount":"10.26","fund_channel":"ALIPAYACCOUNT"},{"amount":"1.24","fund_channel":"DISCOUNT","real_amount":"0.00"}]
使用JDK8运行结果:[{"amount":"10.26","fund_channel":"ALIPAYACCOUNT"},{"real_amount":"0.00","amount":"1.24","fund_channel":"DISCOUNT"}]
fastjson版本: 1.2.35
2条答案
按热度按时间uplii1fm1#
hk8txs482#
@wenshao 按这么写
JSON.parseObject("...", Feature.SortFeidFastMatch)
执行结果还是不一致并且
DEFAULT_PARSER_FEATURE
已经包含了Feature.SortFeidFastMatch