aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/naming/CompoundName.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/naming/CompoundName.java')
-rw-r--r--libjava/classpath/javax/naming/CompoundName.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/libjava/classpath/javax/naming/CompoundName.java b/libjava/classpath/javax/naming/CompoundName.java
index 4b30557f8d3..b23736fa723 100644
--- a/libjava/classpath/javax/naming/CompoundName.java
+++ b/libjava/classpath/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.