1、日期转换默认格式覆盖注解格式的bug;
com.alibaba.fastjson.serializer.JSONSerializer#writeWithFormat
public final void writeWithFormat(Object object, String format) { if (object instanceof Date) { DateFormat dateFormat = this.getDateFormat(); if(format!=null){ dateFormat = new SimpleDateFormat(format, locale); dateFormat.setTimeZone(timeZone); } String text = dateFormat.format((Date) object); out.writeString(text); return; } write(object); }
com.alibaba.fastjson.serializer.SerializeWriter#computeFeatures
protected void computeFeatures() { quoteFieldNames = (this.features & SerializerFeature.QuoteFieldNames.mask) != 0; useSingleQuotes = (this.features & SerializerFeature.UseSingleQuotes.mask) != 0; // sortField = (this.features & SerializerFeature.sortField.mask) != 0; sortField = false; disableCircularReferenceDetect = (this.features & SerializerFeature.disableCircularReferenceDetect.mask) != 0; beanToArray = (this.features & SerializerFeature.BeanToArray.mask) != 0; writeNonStringValueAsstring = (this.features & SerializerFeature.WriteNonStringValueAsstring.mask) != 0; notWriteDefaultValue = (this.features & SerializerFeature.NotWriteDefaultValue.mask) != 0; writeEnumUsingName = (this.features & SerializerFeature.WriteEnumUsingName.mask) != 0; writeEnumUsingToString = (this.features & SerializerFeature.WriteEnumUsingToString.mask) != 0; writeDirect = quoteFieldNames // && (this.features & nonDirectFeautres) == 0 // && (beanToArray || writeEnumUsingName) ; keySeperator = useSingleQuotes ? '\'' : '"'; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。