classpath
[Top][All Lists]
Advanced

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

Re: serialVersionUID


From: Eric Blake
Subject: Re: serialVersionUID
Date: Thu, 26 Sep 2002 15:56:32 -0600
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

If a class has a field (of any accessibility) named serialVersionUID of type long, that is what serialver uses. Otherwise it computes a value using some sort of hash function on the names of all method signatures in the .class file. I'm not sure whether the methods are sorted first, or what the hash function is. The fact that different compilers create different synthetic method signatures, such as access$0() if an inner class needs access to a private member of an enclosing class, make it impossible for two distinct compilers to reliably generate the same serial #, because their .class files differ. However, once you have a .class file, its serial # is unique, and the computation will give the same result no matter what platform you execute on.

Giannis Georgalis wrote:

Thank you Eric, I however had to run the serialver tool on a
i386/solaris8 system (I didn't want to install sun's SDK on my
computer, just for the serialver tool). Does the output match
every system ? Is there a posibility that there are different
serialVersionUIDs for different systems?


--
This signature intentionally left boring.

Eric Blake             address@hidden
  BYU student, free software programmer






reply via email to

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