< prev index next >

src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2020, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -492,29 +492,42 @@
 
 
 //  ---- serialization methods
 
     /**
-     * Overridden to avoid exposing implementation details
-     * @serialData Default field (the attribute ID -- a String),
-     * followed by the number of values (an int), and the
+     * @serialData Default field (the attribute ID - a {@code String}),
+     * followed by the number of values (an {@code int}), and the
      * individual values.
+     *
+     * @param s the {@code ObjectOutputStream} to write to
+     * @throws java.io.IOException if an I/O error occurs.
      */
+    @java.io.Serial
     private void writeObject(java.io.ObjectOutputStream s)
             throws java.io.IOException {
+        // Overridden to avoid exposing implementation details
         s.defaultWriteObject(); // write out the attrID
         s.writeInt(values.size());
         for (int i = 0; i < values.size(); i++) {
             s.writeObject(values.elementAt(i));
         }
     }
 
     /**
-     * Overridden to avoid exposing implementation details.
+     * Initializes the {@code BasicAttribute} from deserialized data.
+     *
+     * See {@code writeObject} for a description of the serial form.
+     *
+     * @param s the {@code ObjectInputStream} to read from
+     * @throws java.io.IOException if an I/O error occurs.
+     * @throws ClassNotFoundException if the class of a serialized object
+     *         could not be found.
      */
+    @java.io.Serial
     private void readObject(java.io.ObjectInputStream s)
             throws java.io.IOException, ClassNotFoundException {
+        // Overridden to avoid exposing implementation details.
         s.defaultReadObject();  // read in the attrID
         int n = s.readInt();    // number of values
         values = new Vector<>(Math.min(1024, n));
         while (--n >= 0) {
             values.addElement(s.readObject());
< prev index next >