FastJsonConfig config = new FastJsonConfig(); config.setSerializerFeatures(new SerializerFeature[]{ SerializerFeature.WriteDateUseDateFormat, SerializerFeature.WriteBigDecimalAsPlain, SerializerFeature.QuoteFieldNames, SerializerFeature.PrettyFormat, SerializerFeature.DisableCircularReferenceDetect});
[ { "auditStatus":30, "id":"03ff2fea48184cdaaafbfc4d74432f5b", "name":"公司", "updateTime":"2021-06-03 14:30:58" } ] 反序列化成类时报错 @Data public class CompanySimpleVo { private String id; private String name; private Date updateTime; }
com.alibaba.fastjson.parser.JSONScanner#scanFieldDate
`
ch = charAt(++bp);//ch可能是空字符串换行符制表符等字符,如果是这样空字符串换行符制表符等字符,后面 matchStat = NOT_MATCH,导致异常 if (ch == ',') { token = JSONToken.COMMA; this.ch = charAt(++bp); } else if (ch == ']') { token = JSONToken.RBRACKET; this.ch = charAt(++bp); } else if (ch == '}') { token = JSONToken.RBRACE; this.ch = charAt(++bp); } else if (ch == EOI) { token = JSONToken.EOF; } else { this.bp = startPos; this.ch = startChar; matchStat = NOT_MATCH; return null; } matchStat = END;
`