不可行的示例:
代码:
Jon jon = JSON.parseObject("{\"dStr\":\" hahahaha \",\"user\":{\"createtime\":null,\"id\":0,\"username\":\" asdfsadf asdf asdf \"}}", Jon.class, parserConfig);
结果:
{"dStr":" hahahaha ","user":{"id":0,"username":" asdfsadf asdf asdf "}}
可行的示例:
代码:
Jon jon1 = JSON.parseObject("{'dStr':' hahahaha ','user':{'createtime':null,'id':0,'username':' asdfsadf asdf asdf '}}", Jon.class, parserConfig);
结果:
{"dStr":"hahahaha","user":{"id":0,"username":"asdfsadf asdf asdf"}}
双引号的没进入DefaultFieldDeserializer,单引号的进入了DefaultFieldDeserializer
com.alibaba.fastjson.parser.deserializer.FastjsonASMDeserializer_1_Jon
两个生成的反序列化对象为同一个,但处理结果不一样,望解答
1条答案
按热度按时间qnzebej01#
问题未重现,请用最新版本1.2.55试试看