aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/naming
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/javax/naming')
-rw-r--r--libjava/classpath/javax/naming/CompoundName.java25
-rw-r--r--libjava/classpath/javax/naming/Name.java4
2 files changed, 24 insertions, 5 deletions
diff --git a/libjava/classpath/javax/naming/CompoundName.java b/libjava/classpath/javax/naming/CompoundName.java
index 4b30557..b23736f 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.
diff --git a/libjava/classpath/javax/naming/Name.java b/libjava/classpath/javax/naming/Name.java
index f8592d9..f047576 100644
--- a/libjava/classpath/javax/naming/Name.java
+++ b/libjava/classpath/javax/naming/Name.java
@@ -1,5 +1,5 @@
/* Name.java -- Name build up from different components
- Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,7 +60,7 @@ import java.util.Enumeration;
* @author Anthony Green (green@redhat.com)
* @author Mark Wielaard (mark@klomp.org)
*/
-public interface Name extends Cloneable, Serializable
+public interface Name extends Cloneable, Serializable, Comparable
{
long serialVersionUID = -3617482732056931635L;