You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
Map<String,String> hash = JSONObject.parseObject(JSON.toJSONString(bean), new TypeReference<Map<String, String>>(){});
方法可以将Bean序列化成Map<String,String>。
JSONObject.toJavaObject((JSONObject)JSON.toJSON(hash),clazz);
方法反序列化成Bean时,如果属性类型为Date值为1970年以前时间时,会报序列化失败。看了下是com.alibaba.fastjson.util.TypeUils类中castToDate方法第307行代码针对format的处理有些问题,不支持“--355132800000”字符串的处理。
建议307行判断条件改为: if(strVal.indexOf('-',1) != -1){
The text was updated successfully, but these errors were encountered: