XJC非瞬态不可序列化实例字段数据
生成 java 类后,我收到:
public class myClass {
@XmlElement(name = "Data", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar data;
@XmlElement(name = "Time", required = true)
protected XMLGregorianCalendar time;
.........
FindBugs 警告 myClass 定义了非瞬态不可序列化实例字段数据。 警告是否可以接受或需要修复? 谢谢。
After generating java classes I received:
public class myClass {
@XmlElement(name = "Data", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar data;
@XmlElement(name = "Time", required = true)
protected XMLGregorianCalendar time;
.........
FindBugs warns that myClass defines non-transient non-serializable instance field data.
Is it warning acceptable or need to fix?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以忽略此警告,这些是为不同的序列化方法 (XML) 设计的特殊类。您不妨设置 findbugs 来忽略整个生成的包。
It's fine to ignore this warning, these are special classes designed for a different serialization method (XML). You might as well set findbugs to ignore the entire generated package.