Commit 03e9b849 by Mattias Rehnberg Committed by Mark Wielaard

2004-11-06 Mattias Rehnberg <Mattias.Rehnberg@home.se>

        * 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
parent a036c6f7
2004-11-06 Mattias Rehnberg <Mattias.Rehnberg@home.se>
* 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.
2004-11-06 Robert Schuster <thebohemian@gmx.net> 2004-11-06 Robert Schuster <thebohemian@gmx.net>
Fixes documentation and indentation Fixes documentation and indentation
......
...@@ -220,7 +220,6 @@ public class ObjectOutputStream extends OutputStream ...@@ -220,7 +220,6 @@ public class ObjectOutputStream extends OutputStream
{ {
Class cl = (Class)obj; Class cl = (Class)obj;
ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(cl); ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(cl);
assignNewHandle(obj);
realOutput.writeByte(TC_CLASS); realOutput.writeByte(TC_CLASS);
if (!osc.isProxyClass) if (!osc.isProxyClass)
{ {
...@@ -241,6 +240,7 @@ public class ObjectOutputStream extends OutputStream ...@@ -241,6 +240,7 @@ public class ObjectOutputStream extends OutputStream
writeObject(osc.getSuper()); writeObject(osc.getSuper());
} }
assignNewHandle(obj);
break; break;
} }
......
...@@ -37,6 +37,9 @@ exception statement from your version. */ ...@@ -37,6 +37,9 @@ exception statement from your version. */
package java.util; package java.util;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.lang.reflect.Array; import java.lang.reflect.Array;
...@@ -912,4 +915,18 @@ public class Vector extends AbstractList ...@@ -912,4 +915,18 @@ public class Vector extends AbstractList
if (index >= elementCount) if (index >= elementCount)
throw new ArrayIndexOutOfBoundsException(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();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment