diff options
author | Jeroen Frijters <jeroen@sumatra.nl> | 2005-09-08 08:32:34 +0000 |
---|---|---|
committer | Jeroen Frijters <jeroen@sumatra.nl> | 2005-09-08 08:32:34 +0000 |
commit | 9bf223ed260a14bd0ed7114b02b65b5fd86e82a6 (patch) | |
tree | 44977d33754f18f9a79adb697bfab1561c9d3386 /javax/naming | |
parent | 1de3c9ab5fbd3f59add4bb4ea63d15ebe0c6b248 (diff) | |
download | classpath-9bf223ed260a14bd0ed7114b02b65b5fd86e82a6.tar.gz |
2005-09-08 Jeroen Frijters <jeroen@frijters.net>
* javax/naming/CompoundName.java
(readObject, writeObject): New methods.
Diffstat (limited to 'javax/naming')
-rw-r--r-- | javax/naming/CompoundName.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/javax/naming/CompoundName.java b/javax/naming/CompoundName.java index 4b30557f8..b23736fa7 100644 --- a/javax/naming/CompoundName.java +++ b/javax/naming/CompoundName.java @@ -38,6 +38,9 @@ exception statement from your version. */ package javax.naming; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.Enumeration; import java.util.NoSuchElementException; @@ -48,9 +51,6 @@ import java.util.Vector; * @author Tom Tromey (tromey@redhat.com) * @date May 16, 2001 * - * FIXME: must write readObject and writeObject to conform to - * serialization spec. - * * FIXME: this class is underspecified. For instance, the `flat' * direction is never described. If it means that the CompoundName * can only have a single element, then the Enumeration-based @@ -469,6 +469,25 @@ public class CompoundName implements Name, Cloneable, Serializable "false")).booleanValue (); } + private void readObject(ObjectInputStream s) + throws IOException, ClassNotFoundException + { + mySyntax = (Properties) s.readObject(); + int count = s.readInt(); + elts = new Vector(count); + for (int i = 0; i < count; i++) + elts.addElement((String) s.readObject()); + } + + private void writeObject(ObjectOutputStream s) + throws IOException + { + s.writeObject(mySyntax); + s.writeInt(elts.size()); + for (int i = 0; i < elts.size(); i++) + s.writeObject(elts.elementAt(i)); + } + // The spec specifies this but does not document it in any way (it // is a package-private class). It is useless as far as I can tell. // So we ignore it. |