iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/naming/CorbaNamingContext.java
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
        /*
        * For serialization, object references are transformed into strings
        */
        for (Name key : this.contexts.keySet()) {
            org.omg.CORBA.Object o = (org.omg.CORBA.Object) this.contexts.remove(key);
            this.contexts.put(key, orb.object_to_string(o));
        }

        for (Name key : this.names.keySet()) {
            org.omg.CORBA.Object o = (org.omg.CORBA.Object) this.names.remove(key);
            this.names.put(key, orb.object_to_string(o));
        }

        out.defaultWriteObject();
    }
private void writeObject(java.io.ObjectOutputStream out) throws IOException {
        /*
        * For serialization, object references are transformed into strings
        */
        for (Name key : this.contexts.keySet()) {
            org.omg.CORBA.Object o = (org.omg.CORBA.Object) this.contexts.remove(key);
            this.contexts.put(key, orb.object_to_string(o));
        }

        for (Name key : this.names.keySet()) {
            org.omg.CORBA.Object o = (org.omg.CORBA.Object) this.names.remove(key);
            this.names.put(key, orb.object_to_string(o));
        }

        out.defaultWriteObject();
    }
<p>
Overrides writeObject in Serializable.
</p>

@param out the {@code OutputStream} where the objects will be written.
@throws IOException if an error occurs while writing the objects to the stream.