In order for serialization to gracefully detect when a versioning problem has occurred, it needs to be able to detect when a class has changed. As with all the other aspects of serialization, there is a default way that serialization does this. And there is a way for you to override the default.
The default involves a hashcode. Serialization creates a single hashcode, of type long, from the following information:
The default involves a hashcode. Serialization creates a single hashcode, of type long, from the following information:
- The class name and modifiers
- The names of any interfaces the class implements
- Descriptions of all methods and constructors except private methods and constructors
- Descriptions of all fields except private, static, and private transient
Posted in: