使用json中
public static <T> T reSerializableJson(String jsonStr, TypeReference<T> type) {
return JSONArray.parseObject(jsonStr, type);
}
这里将默认使用HashMap, 如果我们的类字段使用ConcurrentHashMap的话,可能会出现奇奇怪怪的问题,譬如
ConcurrentHashMap的get(key)中key不能null,会报nullpointException
HashMap则不会
程序会表现运行异常,重启走json序列化反而正常的异像