--- old/src/java.naming/share/classes/javax/naming/CompositeName.java 2020-08-25 15:53:55.574355171 +0100 +++ new/src/java.naming/share/classes/javax/naming/CompositeName.java 2020-08-25 15:53:55.418358014 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -562,12 +562,16 @@ } /** - * Overridden to avoid implementation dependency. * @serialData The number of components (an {@code int}) followed by * 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.writeInt(size()); Enumeration comps = getAll(); while (comps.hasMoreElements()) { @@ -576,10 +580,19 @@ } /** - * Overridden to avoid implementation dependency. + * Initializes the {@code CompositeName} 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 impl = new NameImpl(null); // null means use default syntax int n = s.readInt(); // number of components try { --- old/src/java.naming/share/classes/javax/naming/CompoundName.java 2020-08-25 15:53:56.142344817 +0100 +++ new/src/java.naming/share/classes/javax/naming/CompoundName.java 2020-08-25 15:53:55.982347733 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -547,13 +547,17 @@ } /** - * 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 comps = getAll(); @@ -563,10 +567,19 @@ } /** - * 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 --- old/src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java 2020-08-25 15:53:56.726334173 +0100 +++ new/src/java.naming/share/classes/javax/naming/directory/BasicAttribute.java 2020-08-25 15:53:56.566337089 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -494,13 +494,17 @@ // ---- 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++) { @@ -509,10 +513,19 @@ } /** - * 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)); --- old/src/java.naming/share/classes/javax/naming/directory/BasicAttributes.java 2020-08-25 15:53:57.298323747 +0100 +++ new/src/java.naming/share/classes/javax/naming/directory/BasicAttributes.java 2020-08-25 15:53:57.142326590 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -279,13 +279,17 @@ } /** - * Overridden to avoid exposing implementation details. - * @serialData Default field (ignoreCase flag -- a boolean), followed by + * @serialData Default field (ignoreCase flag - a {@code boolean}), followed by * the number of attributes in the set - * (an int), and then the individual Attribute objects. + * (an {@code int}), and then the individual {@code Attribute} objects. + * + * @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 ignoreCase flag s.writeInt(attrs.size()); Enumeration attrEnum = attrs.elements(); @@ -295,10 +299,19 @@ } /** - * Overridden to avoid exposing implementation details. + * Initializes the {@code BasicAttributes} 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 ignoreCase flag int n = s.readInt(); // number of attributes attrs = (n >= 1) --- old/src/java.naming/share/classes/javax/naming/ldap/LdapName.java 2020-08-25 15:53:57.866313394 +0100 +++ new/src/java.naming/share/classes/javax/naming/ldap/LdapName.java 2020-08-25 15:53:57.706316310 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -758,14 +758,29 @@ * Serializes only the unparsed DN, for compactness and to avoid * any implementation dependency. * - * @serialData The DN string + * @serialData The DN {@code String} representation of this LDAP name. + * + * @param s the {@code ObjectOutputStream} to write to + * @throws java.io.IOException if an I/O error occurs. */ + @java.io.Serial private void writeObject(ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); s.writeObject(toString()); } + /** + * Initializes the {@code LdapName} 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(ObjectInputStream s) throws java.io.IOException, ClassNotFoundException { s.defaultReadObject(); --- old/src/java.naming/share/classes/javax/naming/ldap/Rdn.java 2020-08-25 15:53:58.438302968 +0100 +++ new/src/java.naming/share/classes/javax/naming/ldap/Rdn.java 2020-08-25 15:53:58.278305884 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -735,14 +735,29 @@ * Serializes only the unparsed RDN, for compactness and to avoid * any implementation dependency. * - * @serialData The RDN string + * @serialData The unparsed RDN {@code String} representation. + * + * @param s the {@code ObjectOutputStream} to write to + * @throws java.io.IOException if an I/O error occurs. */ + @java.io.Serial private void writeObject(ObjectOutputStream s) throws java.io.IOException { s.defaultWriteObject(); s.writeObject(toString()); } + /** + * Initializes the {@code Rdn} from deserialized data. + * + * See {@code writeObject} for a description of the serial form. + * + * @param s the {@code ObjectInputStream} to read from + * @throws 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(ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); --- old/src/java.naming/share/classes/javax/naming/spi/NamingManager.java 2020-08-25 15:53:59.014292469 +0100 +++ new/src/java.naming/share/classes/javax/naming/spi/NamingManager.java 2020-08-25 15:53:58.850295458 +0100 @@ -948,6 +948,10 @@ return (answer != null) ? answer : obj; } + /** + * Thrown when an error is encountered while loading and instantiating the + * context factory classes. + */ private static class FactoryInitializationError extends Error { @java.io.Serial static final long serialVersionUID = -5805552256848841560L;