< prev index next >

src/java.naming/share/classes/javax/naming/CompoundName.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2019, 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

@@ -545,30 +545,43 @@
     public Object remove(int posn) throws InvalidNameException {
         return impl.remove(posn);
     }
 
     /**
-     * Overridden to avoid implementation dependency.
      * @serialData The syntax {@code Properties}, followed by
      * the number of components (an {@code int}), and the individual
      * components (each a {@code String}).
+     *
+     * @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 implementation dependency
         s.writeObject(mySyntax);
         s.writeInt(size());
         Enumeration<String> comps = getAll();
         while (comps.hasMoreElements()) {
             s.writeObject(comps.nextElement());
         }
     }
 
     /**
-     * Overridden to avoid implementation dependency.
+     * Initializes the {@code CompoundName} 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 implementation dependency.
         mySyntax = (Properties)s.readObject();
         impl = new NameImpl(mySyntax);
         int n = s.readInt();    // number of components
         try {
             while (--n >= 0) {
< prev index next >