"
laredo...@zipmail.com" <
laredo...@gmail.com> wrote in
news:a3ed0747-5eb5-4da1...@v13g2000yqc.googlegroups.com:
Not relevant.
> and getter/setter methods for
> all the fields you see (except serialVersionUID).
Not relevant, I think.
> Any ideas why
> FindBugs is complaining about the field "children" or how I can
> troubleshoot this further?
If I recall correctly, a class cannot be serialized unless all of its
fields are either Serializable or marked transient (or unless special
methods are written).
Primitives (long, in your casse) are always Serializable.
String is Serializable.
List is NOT Serializable, and you have not marked children and attributes
as transient. This will lead to a NotSerializableException at the time of
serialization.
Node cannot be serialized unless its nontransient fields can be serialized.
(Obviously, transient fields don't get serialized and don't get restored by
deserialization.)
<class Attribute snipped as not relevant>
The choices would seem to be:
Don't make Node Serializable, or
Mark children and attributes as transient, or
Use something Serializable in place of List (such as ArrayList), or
Provide writeObject and readObject methods (or writeReplace and
readResolve, or...) to appropriately serialize Node objects.