RFR 8251203: Fix "no comment" warnings in java.base/java.lang and java/io

Roger Riggs Roger.Riggs at oracle.com
Fri Aug 21 17:51:24 UTC 2020


Hi Daniel,

Re-reading the java.io.Serial javadoc, the annotation is only appropriate on
the methods and fields specified as being part of the Serializalble 
mechanism.
For example, readObject, writeObject, readResolve, wroteReplace, and 
readObjectNoData,
and fields serialPersistentFields and serialVersionUID.

So no, not applied to serializable fields.

The serialized form is based on the non-transient fields of Serialiable 
classes
and annotations for @serialData, serialVersionUID, and 
serialPersistentFields, etc.

Thanks, Roger


On 8/21/20 1:32 PM, Daniel Fuchs wrote:
> Hi Roger,
>
> On 21/08/2020 17:52, Roger Riggs wrote:
>> The @serial javadoc tag is used on any serialization related field or 
>> method.
>> Are there some missing? I expect javac would warn if they were missing.
>
> Well I was wondering whether an @serial tag would be appropriate in
> the documentation of these fields, for instance:
> http://cr.openjdk.java.net/~rriggs/webrev-nocomment-8251203-2/src/java.base/share/classes/java/lang/StackTraceElement.java.frames.html 
>
>
> The only purpose of documenting these fields is for the
> SerializedForm, isn't it?
>
> best regards,
>
> -- daniel



More information about the core-libs-dev mailing list