JDK 14 RFR of JDK-8229997: Apply java.io.Serial annotations in java.base

Joe Darcy joe.darcy at oracle.com
Wed Aug 28 16:08:18 UTC 2019

Hi Alan,

On 8/27/2019 11:39 PM, Alan Bateman wrote:
> On 28/08/2019 02:28, Joe Darcy wrote:
>> Hello,
>> Recent work for JDK-8202385: "Annotation to mark serial-related 
>> fields and methods" added the java.io.Serial annotation type to the 
>> platform. The intention of this new annotation type is to allow 
>> serialization-related fields and methods to be marked as 
>> documentation and to allow stricter compile-time checking, analogous 
>> to the checking done for @Override. Implementing those stricter 
>> serialization-related checks will be done under JDK-8202056.
>> Please review the application of java.io.Serial to types in the base 
>> module other than security types:
>>     JDK-8229997: Apply java.io.Serial annotations in java.base
>>     http://cr.openjdk.java.net/~darcy/8229997.0/
> There are exception classes in java.base that are generated at build 
> time so I think you'll need to update make/scripts/genExceptions.sh to 
> ensure that the serialVersionUID in those classes are annotated.
The intention here is to be "mostly exhaustive" rather than "entirely 
exhaustive" in applying the annotation type so I'd prefer to defer 
updating generated exceptions to future work.

 From some off-list discussions with Stuart and Roger, the envisioned 
nature of the compile-time checking is that the full suite of new checks 
would only be enabled if the annotations are present. Some additional 
checking would occur without the annotation, such as an ineffectual 
serialVersionUID in an enum type.



More information about the core-libs-dev mailing list