classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: serialVersionUID problem


From: Andrew Haley
Subject: Re: serialVersionUID problem
Date: Thu, 19 Jan 2006 12:24:47 +0000

hultul writes:
 > Hi, all~
 > 
 > I did some tests of java.io.Serializable's serialVersionUID using cp-tools.
 > All the VM's used in tests were from Debian testing release.
 > 
 > As a result, kaffe, jamvm, sablevm, and gij showed different results from
 > Sun's java, where gij in GCC-3.4.3 not in Debian testing release showed same
 > one with Sun's.
 > 
 > I guess that there is a problem in java.io.ObjectStreamClass.getClassUID()
 > or its calling methods in GNU Classpath.
 > 
 > What do you think about this?

We use the correct algorithm, but serialVersionUIDs aren't guaranteed
to be the same between libraries, and cannot be.  If you want the
serialVersionUID of a class of your own to be fixed, you must declare
the field explicitly.  Some Java compilers (e.g. ecj) emit a warning
if you fail to do so.

Andrew.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]