Hello,

Do we need to have serialVersionUIDs for all Serializable classes even if those
fields are missing in API Spec or we might omit them?

According to Java Object Serialization Specification, 4.6
http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/class.html#4100

"It is strongly recommended that all serializable classes explicitly declare
serialVersionUID values, since the default serialVersionUID
computation is highly
sensitive to class details that may vary depending on compiler implementations,
and can thus result in unexpected serialVersionUID conflicts during
deserialization,
causing deserialization to fail"

I suggest to have these fields for all serialized classes, unless
there is a particular
reason for those classes not to have serialVersionUID

(And I'm not saying that we need them instead of serialization tests :)

Opinions?

Thanks,
Mikhail Loenko
Intel Middleware Products Division

Reply via email to