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

@ -41,6 +41,7 @@ import java.security.PrivilegedAction;
* @since 1.5
*/
class AnnotationInvocationHandler implements InvocationHandler, Serializable {
@java.io.Serial
private static final long serialVersionUID = 6182022883658399397L;
private final Class<? extends Annotation> type;
private final Map<String, Object> memberValues;
@ -603,6 +604,7 @@ class AnnotationInvocationHandler implements InvocationHandler, Serializable {
return Arrays.hashCode((Object[]) value);
}
@java.io.Serial
private void readObject(java.io.ObjectInputStream s)
throws java.io.IOException, ClassNotFoundException {
ObjectInputStream.GetField fields = s.readFields();

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -34,6 +34,7 @@ import java.lang.reflect.Method;
* @since 1.5
*/
class AnnotationTypeMismatchExceptionProxy extends ExceptionProxy {
@java.io.Serial
private static final long serialVersionUID = 7844069490309503934L;
private Method member;
private final String foundType;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -32,6 +32,7 @@ package sun.reflect.annotation;
* @since 1.5
*/
public class EnumConstantNotPresentExceptionProxy extends ExceptionProxy {
@java.io.Serial
private static final long serialVersionUID = -604662101303187330L;
final Class<? extends Enum<?>> enumType;
final String constName;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -37,6 +37,7 @@ package sun.reflect.annotation;
* @since 1.5
*/
public abstract class ExceptionProxy implements java.io.Serializable {
@java.io.Serial
private static final long serialVersionUID = 7241930048386631401L;
protected abstract RuntimeException generateException();
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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
@ -33,6 +33,7 @@ import java.lang.annotation.*;
* @since 1.5
*/
public class TypeNotPresentExceptionProxy extends ExceptionProxy {
@java.io.Serial
private static final long serialVersionUID = 5565925172427947573L;
final String typeName;
final Throwable cause;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -27,5 +27,6 @@ package sun.reflect.generics.reflectiveObjects;
/** Temporary class used to indicate missing functionality */
public class NotImplementedException extends RuntimeException {
@java.io.Serial
private static final long serialVersionUID = -9177857708926624790L;
}