From 03e9b84966702f926adfbf2c1cfe0cce0a7e72ae Mon Sep 17 00:00:00 2001 From: Mattias Rehnberg Date: Sat, 6 Nov 2004 16:52:00 +0100 Subject: 2004-11-06 Mattias Rehnberg * java/io/Vector.java (writeObject): New function to serialized output thread safe. * java/io/ObjectOutputStream.java (writeObject): Move the assignment of the class handle to after the assignment of class descriptor handle. From-SVN: r90175 --- libjava/java/util/Vector.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libjava/java/util/Vector.java') diff --git a/libjava/java/util/Vector.java b/libjava/java/util/Vector.java index d72788e3018..edc14a4e99a 100644 --- a/libjava/java/util/Vector.java +++ b/libjava/java/util/Vector.java @@ -37,6 +37,9 @@ exception statement from your version. */ package java.util; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; import java.io.Serializable; import java.lang.reflect.Array; @@ -912,4 +915,18 @@ public class Vector extends AbstractList if (index >= elementCount) throw new ArrayIndexOutOfBoundsException(index + " >= " + elementCount); } + + /** + * Serializes this object to the given stream. + * + * @param s the stream to write to + * @throws IOException if the underlying stream fails + * @serialData just calls default write function + */ + private synchronized void writeObject(ObjectOutputStream s) + throws IOException + { + s.defaultWriteObject(); + } + } -- cgit v1.2.3