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

@ -1013,6 +1013,7 @@ public abstract class NumberFormat extends Format {
*
* @since 1.2
*/
@java.io.Serial
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException
{
@ -1041,6 +1042,7 @@ public abstract class NumberFormat extends Format {
*
* @since 1.2
*/
@java.io.Serial
private void writeObject(ObjectOutputStream stream)
throws IOException
{
@ -1225,6 +1227,7 @@ public abstract class NumberFormat extends Format {
// Removed "implements Cloneable" clause. Needs to update serialization
// ID for backward compatibility.
@java.io.Serial
static final long serialVersionUID = -2308460125733713944L;
@ -1242,6 +1245,7 @@ public abstract class NumberFormat extends Format {
public static class Field extends Format.Field {
// Proclaim serial compatibility with 1.4 FCS
@java.io.Serial
private static final long serialVersionUID = 7494728892700160890L;
// table of all instances in this class, used by readResolve
@ -1267,6 +1271,7 @@ public abstract class NumberFormat extends Format {
* @return resolved NumberFormat.Field constant
*/
@Override
@java.io.Serial
protected Object readResolve() throws InvalidObjectException {
if (this.getClass() != NumberFormat.Field.class) {
throw new InvalidObjectException("subclass didn't correctly implement readResolve");