--- 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