JDK 9 RFR of JDK-8035453: Fix serial lint warnings in com.sun.tools and elsewhere
joe.darcy at oracle.com
Tue Feb 25 02:22:11 UTC 2014
On 02/24/2014 03:23 AM, Paul Sandoz wrote:
> Hi Joe,
> On Feb 20, 2014, at 10:14 PM, Joe Darcy<joe.darcy at oracle.com> wrote:
>> Please review my proposed changes for:
>> JDK-8035453: Fix serial lint warnings in com.sun.tools and elsewhere
> Looks good.
> I agree with Paul B. that it seems a little odd to have to suppress serialization on an abstract class, especially one that implements Serializable (plus Connector.Argument also extends Serializable):
Despite cleaning up many serial warnings, I've tried hard to avoid
learning too much about the serialization wire protocol ;-)
From what I was able to discern by reading the serialization
specification , If a class does *not* declare a serialVersionUID, the
serialVersionUID of its superclass is *not* included in the serialver
hash computation of the child class. However, my understanding is that
changes to the fields stored in superclass and changes to the semantics
of its readObject / writeObjects methods could affect the serialization
of the child class.
Therefore, if that understanding is correct, it seems reasonable for
javac to warn about serializable abstract classes even though one cannot
have bare instances of the class.
Thanks for the review,
More information about the core-libs-dev