Are java built-in classes like hashmap ever changing their serialVersionUID?

In many of my database objects, I store a serialized hash map of various values. How likely is the hashmap java built-in class to change serialVersionUID so that I can no longer deserialize hashmaps from the database?

Could this happen with a new version of the Java version?

+5
source share
3 answers

Could this happen with a new version of the Java version?

If something can happen, it will be :), but seriously, if they change serialVersionUID, they set it to be backward-incompatible. Something that probably has not happened over the years.

, , 'default' serialVersionUID

+2

, . Java serialVersionUID ( 4 - http://download.oracle.com/javase/6/docs/platform/serialization/spec/class.html#4100), , , ( 5 - http://download.oracle.com/javase/6/docs/platform/serialization/spec/version.html).

. Java HashMap, UID . Java 5 , Java - , . , . , , - , HashMap :), , .

+1

You are not "completely safe." This happened in the case of one of the RowSet implementations, and it is not guaranteed that this will not happen for all Swing.

However, it remains unlikely for the main classes.

0
source

All Articles