mercredi 7 décembre 2016

why is not safe to rely on ObjectStreamClass.getSerialVersionUID?

The java spec says: "it is strongly recommended that all serializable classes explicitly declare serialVersionUID values, since the default serialVersionUID computation is highly sensitive to class details that may vary depending on compiler implementations"

Please could someone dig into this? The getSerialVersionUID() method does reflection, and reflection is used commonly everywhere, so what is compiler-dependent?





Aucun commentaire:

Enregistrer un commentaire