M
Mark Rafn
Somehow I managed not to specify serialVersionUID in some Serializable
classes, and now have saved data with multiple logically-compatible but
serialVersionUID-incompatible formats.
I have since changed the code to specify a serialVersionUID, which will
prevent this in the future.
Is there any way to write code to read the multiple old versions, which
differ ONLY in serialVersionUID? Basically, I'd really love a subclass of
ObjectInputStream that just doesn't look at this field in objects it reads.
Looking at the ObjectInputStream javadoc, it appears I can subclass it and
write my own readObjectOverride, but it would appear to be quite a bit of
implementation to make it work.
Anyone know an easier way, or have any gotchas if I do it myself?
classes, and now have saved data with multiple logically-compatible but
serialVersionUID-incompatible formats.
I have since changed the code to specify a serialVersionUID, which will
prevent this in the future.
Is there any way to write code to read the multiple old versions, which
differ ONLY in serialVersionUID? Basically, I'd really love a subclass of
ObjectInputStream that just doesn't look at this field in objects it reads.
Looking at the ObjectInputStream javadoc, it appears I can subclass it and
write my own readObjectOverride, but it would appear to be quite a bit of
implementation to make it work.
Anyone know an easier way, or have any gotchas if I do it myself?