当fastjson解析Integer类型时,遇到空字符串时会转换为null值。
你可以使用如下的代码来进行测试:
Stringjson = "''";
Integer value = JSON.parseObject(json, Integer.class);
System.out.println(value); // 输出:null
当fastjson解析Integer类型时,遇到空字符串时会转换为null值。
你可以使用如下的代码来进行测试:
Stringjson = "''";
Integer value = JSON.parseObject(json, Integer.class);
System.out.println(value); // 输出:null