< prev index next >

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

Print this page

        

*** 148,157 **** --- 148,158 ---- */ public final class SocketPermission extends Permission implements java.io.Serializable { + @java.io.Serial private static final long serialVersionUID = -7204263841984476862L; /** * Connect to host:port */
*** 1184,1193 **** --- 1185,1195 ---- /** * 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,1207 **** --- 1200,1210 ---- /** * 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,1455 **** --- 1449,1459 ---- @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,1470 **** --- 1465,1475 ---- /** * @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,1481 **** --- 1477,1487 ---- */ /* * 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,1495 **** --- 1492,1502 ---- } /* * 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 >