mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8229997: Apply java.io.Serial annotations in java.base
Reviewed-by: alanb, rriggs
This commit is contained in:
parent
6d064a747e
commit
9d764ee48e
315 changed files with 880 additions and 254 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 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
|
||||
|
@ -150,6 +150,7 @@ import sun.security.util.Debug;
|
|||
public final class SocketPermission extends Permission
|
||||
implements java.io.Serializable
|
||||
{
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = -7204263841984476862L;
|
||||
|
||||
/**
|
||||
|
@ -1186,6 +1187,7 @@ public final class SocketPermission extends Permission
|
|||
* to a stream. The actions are serialized, and the superclass
|
||||
* takes care of the name.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private synchronized void writeObject(java.io.ObjectOutputStream s)
|
||||
throws IOException
|
||||
{
|
||||
|
@ -1200,6 +1202,7 @@ public final class SocketPermission extends Permission
|
|||
* readObject is called to restore the state of the SocketPermission from
|
||||
* a stream.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private synchronized void readObject(java.io.ObjectInputStream s)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
|
@ -1448,6 +1451,7 @@ final class SocketPermissionCollection extends PermissionCollection
|
|||
return (Enumeration)Collections.enumeration(perms.values());
|
||||
}
|
||||
|
||||
@java.io.Serial
|
||||
private static final long serialVersionUID = 2787186408602843674L;
|
||||
|
||||
// Need to maintain serialization interoperability with earlier releases,
|
||||
|
@ -1463,6 +1467,7 @@ final class SocketPermissionCollection extends PermissionCollection
|
|||
* @serialField permissions java.util.Vector
|
||||
* A list of the SocketPermissions for this set.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private static final ObjectStreamField[] serialPersistentFields = {
|
||||
new ObjectStreamField("permissions", Vector.class),
|
||||
};
|
||||
|
@ -1474,6 +1479,7 @@ final class SocketPermissionCollection extends PermissionCollection
|
|||
* Writes the contents of the perms field out as a Vector for
|
||||
* serialization compatibility with earlier releases.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void writeObject(ObjectOutputStream out) throws IOException {
|
||||
// Don't call out.defaultWriteObject()
|
||||
|
||||
|
@ -1488,6 +1494,7 @@ final class SocketPermissionCollection extends PermissionCollection
|
|||
/*
|
||||
* Reads in a Vector of SocketPermissions and saves them in the perms field.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private void readObject(ObjectInputStream in)
|
||||
throws IOException, ClassNotFoundException
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue