8229997: Apply java.io.Serial annotations in java.base

Reviewed-by: alanb, rriggs
This commit is contained in:
Joe Darcy 2019-08-29 16:31:34 -07:00
parent 6d064a747e
commit 9d764ee48e
315 changed files with 880 additions and 254 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -77,6 +77,7 @@ public class UnsupportedTemporalTypeException extends DateTimeException {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -6158898438688206006L;
/**

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -92,6 +92,7 @@ public final class ValueRange implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -7317881728594519368L;
/**
@ -352,6 +353,7 @@ public final class ValueRange implements Serializable {
* or the largest minimum is greater than the largest maximum
* @throws ClassNotFoundException if a class cannot be resolved
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException, InvalidObjectException
{

View file

@ -242,6 +242,7 @@ public final class WeekFields implements Serializable {
/**
* Serialization version.
*/
@java.io.Serial
private static final long serialVersionUID = -1177360819670808121L;
/**
@ -362,6 +363,7 @@ public final class WeekFields implements Serializable {
* value for firstDayOfWeek or minimalDays.
* @throws ClassNotFoundException if a class cannot be resolved
*/
@java.io.Serial
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException, InvalidObjectException
{
@ -382,6 +384,7 @@ public final class WeekFields implements Serializable {
* @throws InvalidObjectException if the serialized object has invalid
* values for firstDayOfWeek or minimalDays.
*/
@java.io.Serial
private Object readResolve() throws InvalidObjectException {
try {
return WeekFields.of(firstDayOfWeek, minimalDays);