harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib] serialVersionUIDs for Serializable classes
Date Thu, 19 Jan 2006 12:02:35 GMT
Mikhail Loenko wrote:
> 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?

I agree.
(I suppose I should get used to just saying "+1", to fit in round here).


> Thanks,
> Mikhail Loenko
> Intel Middleware Products Division


Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

View raw message