commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject Re: [chain2] serialVersionUID
Date Tue, 24 Jul 2012 05:51:35 GMT
Hi Elijah

Elijah Zupancic wrote:

> Hi everyone,
> Now that we have changed the chain API to not be backwards compatible
> in the 2.0 release, should we change the version number in the
> serialVersionUID fields as well? It seems to me that would make sense,
> but I'm a bit of a newbie when it comes to managing their versions. I
> was wondering if anyone else has experience with regards to best
> practices?

The serialVersionUID of a class has to be changed if its binary layout 
- the class or an inherited class has been renamed or moved to a different 
- the field types of the (inherited) members have been changed or changed 
between transient/non-transient
- the *order* of one of the (inherited) fields have been changed
- serialization methods have 
(writeObject/readObject/writeReplace/readResolve) been added/removed in the 
class hierarchy in an incompatible way
- the implementation of those methods have been changed in an incompatible 

Basically, the serialVersionUID has to be changed if you cannot load a .ser 
file anymore with an instance of that class which was written with the old 

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message