diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
commit | 8f523f3a1047919d3563daf1ef47ba87336ebe89 (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/javax/naming | |
parent | 02e549bfaaec38f68307e7f34e46ea57ea1809af (diff) | |
download | gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.zip gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.gz gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.bz2 |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
From-SVN: r107049
Diffstat (limited to 'libjava/classpath/javax/naming')
-rw-r--r-- | libjava/classpath/javax/naming/CompoundName.java | 25 | ||||
-rw-r--r-- | libjava/classpath/javax/naming/Name.java | 4 |
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; |