harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mikhail Loenko <mloe...@gmail.com>
Subject [classlib] serialVersionUIDs for Serializable classes
Date Thu, 19 Jan 2006 08:59:46 GMT

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

"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
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 :)


Mikhail Loenko
Intel Middleware Products Division

View raw message