踩坑:FastJson可正常反序列化字符串null,返回null,而不会抛出JsonException异常
try {
User user = JSON.parseObject("null", User.class);
if (user == null) {
System.out.print("user = null");
}
} catch (Exception e) {
e.printStackTrace();
}
public class User {
private String name;
}