Lambdas and serialization
Alessio Stalla
alessiostalla at gmail.com
Wed Oct 20 00:54:13 PDT 2010
On Wed, Oct 20, 2010 at 9:49 AM, Mark Thornton <mthornton at optrak.co.uk> wrote:
> On 19/10/2010 23:40, Bob Lee wrote:
>>
>> That's actually not true. If a class is serializable, its serialized form is
>> part of the published API, and you are guaranteed compatibility across VMs
>> and VM versions.
>>
> Only true if you explicitly specify the serialVersionUID. The default
> calculation includes methods which are implementation artifacts of a
> particular compiler.
True, for user-defined classes. But for implementation-defined
classes, you don't have any guarantee. In fact if you look at the
documentation for Swing components, which are serializable, you'll
find a big disclaimer along the lines of "only use serialization for
short-term storage".
More information about the lambda-dev
mailing list