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?
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.
JDK 6 : http://www.oracle.com/technetwork/java/javase/compatibility-137541.html#incompatibilities
JDK 5: http://java.sun.com/j2se/1.5.0/compatibility.html#incompatibilities
JDK 1.4 : http://java.sun.com/javase/compatibility_j2se1.4.html#incompatibilities1.4
JDK 1.3 : http://java.sun.com/j2se/1.3/compatibility.html#incompatibilities1.3
JDK 1.2 : http://java.sun.com/products/archive/j2se/1.2.2_017/compatibility.html#incompatibilities1.2
, , 'default' serialVersionUID
, . 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 :), , .
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.