JDK 9 RFR of JDK-8035453: Fix serial lint warnings in com.sun.tools and elsewhere
Joe Darcy
joe.darcy at oracle.com
Tue Feb 25 02:22:11 UTC 2014
Hi Paul,
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:
>
>> bHello,
>>
>> Please review my proposed changes for:
>>
>> JDK-8035453: Fix serial lint warnings in com.sun.tools and elsewhere
>> http://cr.openjdk.java.net/~darcy/8035453.0/webrev/
>>
> 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 [1], 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,
-Joe
[1]
http://docs.oracle.com/javase/7/docs/platform/serialization/spec/class.html#4100
More information about the core-libs-dev
mailing list