JDK 14 RFR of JDK-8202385: Annotation to mark serial-related fields and methods
roger.riggs at oracle.com
Fri Jul 12 20:31:53 UTC 2019
As an annotation on a field or method, this is a use site annotation.
From the description, the checks that could be added would only be done
if the annotation was present and the annotation is a tag for existing
fields and methods that are part of the serialization spec.
The signatures of the fields and methods can be known to the compiler
of the annotation and produce the same warnings.
So this looks like a case of trying to have belt and suspenders.
If the checks are not done when the annotation is not present, then it
will still be
the case that incorrect or misused fields and methods will still escape
Though the details of the compiler check are outside of the scope of
it seems unclear whether the annotation is necessary.
Can the name of the annotation be more descriptive?
Just "Serial" seems a bit too simple and does not have a strong binding
to the Serialization classes and specification.
39: There should be a reference to the serialization specification for
of the fields and methods to make it clear where the authoritative
identification is spec'd.
73-75: Please align the <ul> and </ul> tags on separate lines with
77: Extra leading space.
On 7/9/19 7:14 PM, Joe Darcy wrote:
> Returning to some old work , please review the addition of a
> java.io.Serial annotation type for JDK 14 to mark serial-related
> fields and methods:
> webrev: http://cr.openjdk.java.net/~darcy/8202385.3/
> CSR: https://bugs.openjdk.java.net/browse/JDK-8217698
>  Previous review threads:
More information about the core-libs-dev