< prev index next >

src/java.base/share/classes/java/net/SocketPermission.java

Print this page

        

@@ -148,10 +148,11 @@
  */
 
 public final class SocketPermission extends Permission
     implements java.io.Serializable
 {
+    @java.io.Serial
     private static final long serialVersionUID = -7204263841984476862L;
 
     /**
      * Connect to host:port
      */

@@ -1184,10 +1185,11 @@
     /**
      * WriteObject is called to save the state of the SocketPermission
      * 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
     {
         // Write out the actions. The superclass takes care of the name
         // call getActions to make sure actions field is initialized

@@ -1198,10 +1200,11 @@
 
     /**
      * 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
     {
         // Read in the action, then initialize the rest
         s.defaultReadObject();

@@ -1446,10 +1449,11 @@
     @SuppressWarnings("unchecked")
     public Enumeration<Permission> elements() {
         return (Enumeration)Collections.enumeration(perms.values());
     }
 
+    @java.io.Serial
     private static final long serialVersionUID = 2787186408602843674L;
 
     // Need to maintain serialization interoperability with earlier releases,
     // which had the serializable field:
 

@@ -1461,10 +1465,11 @@
 
     /**
      * @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),
     };
 
     /**

@@ -1472,10 +1477,11 @@
      */
     /*
      * 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()
 
         // Write out Vector
         Vector<SocketPermission> permissions = new Vector<>(perms.values());

@@ -1486,10 +1492,11 @@
     }
 
     /*
      * Reads in a Vector of SocketPermissions and saves them in the perms field.
      */
+    @java.io.Serial
     private void readObject(ObjectInputStream in)
         throws IOException, ClassNotFoundException
     {
         // Don't call in.defaultReadObject()
 
< prev index next >