On 01/15/2013 02:57 PM, Alan Bateman wrote:
On 15/01/2013 13:49, Chris Hegarty wrote:
But wouldn't there be an issue with JDK7 TLR streams being
deserialized by JDK8, pad fields would be left in the Object input
steam? If so, then we're down the road of having to have a
readObject, etc... and possibly back to serialPersistentFields?
Technically deleting fields is an incompatible change as the stream
will not contain the fields. If someone is crazy enough to serialize
with jdk8 TLR and send it to a jdk7 release then the fields will have
their default value (as the values aren't in the stream). As the
fields aren't used then I don't think this should make a difference.
Going the other way shouldn't be an issue either as the pad fields
will be ignored.
-Alan.
Should there also be a change/patch to JDK7 TLR that would "fix" the
strange behaviour (by adding readResolve)? This would align the
semantics no matter which direction (7/7, 7/8, 8/7, 8/8) of
serialization/deserialization is used...
Regards, Peter