src/java.base/share/classes/javax/security/auth/Subject.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 47216 71c04702a3d5
child 58679 9c3209ff7550
--- a/src/java.base/share/classes/javax/security/auth/Subject.java	Thu Oct 17 20:27:44 2019 +0100
+++ b/src/java.base/share/classes/javax/security/auth/Subject.java	Thu Oct 17 20:53:35 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -100,6 +100,7 @@
  */
 public final class Subject implements java.io.Serializable {
 
+    @java.io.Serial
     private static final long serialVersionUID = -8308522755600156056L;
 
     /**
@@ -110,6 +111,7 @@
      *          {@code java.security.Principal}.
      *          The set is a {@code Subject.SecureSet}.
      */
+    @SuppressWarnings("serial") // Not statically typed as Serializable
     Set<Principal> principals;
 
     /**
@@ -946,6 +948,7 @@
     /**
      * Writes this object out to a stream (i.e., serializes it).
      */
+    @java.io.Serial
     private void writeObject(java.io.ObjectOutputStream oos)
                 throws java.io.IOException {
         synchronized(principals) {
@@ -957,6 +960,7 @@
      * Reads this object from a stream (i.e., deserializes it)
      */
     @SuppressWarnings("unchecked")
+    @java.io.Serial
     private void readObject(java.io.ObjectInputStream s)
                 throws java.io.IOException, ClassNotFoundException {
 
@@ -1027,12 +1031,14 @@
     private static class SecureSet<E>
         implements Set<E>, java.io.Serializable {
 
+        @java.io.Serial
         private static final long serialVersionUID = 7911754171111800359L;
 
         /**
          * @serialField this$0 Subject The outer Subject instance.
          * @serialField elements LinkedList The elements in this set.
          */
+        @java.io.Serial
         private static final ObjectStreamField[] serialPersistentFields = {
             new ObjectStreamField("this$0", Subject.class),
             new ObjectStreamField("elements", LinkedList.class),
@@ -1408,6 +1414,7 @@
          *      in the set.  If the security check passes,
          *      the set is serialized.
          */
+        @java.io.Serial
         private void writeObject(java.io.ObjectOutputStream oos)
                 throws java.io.IOException {
 
@@ -1426,6 +1433,7 @@
         }
 
         @SuppressWarnings("unchecked")
+        @java.io.Serial
         private void readObject(ObjectInputStream ois)
             throws IOException, ClassNotFoundException
         {