ObjectStreamClass.java (ensureFieldsSet): New method.

2007-04-25  Andrew Haley  <aph@redhat.com>

	* java/io/ObjectStreamClass.java (ensureFieldsSet): New method.
	(setFields): call ensureFieldsSet.
	(fieldsSet): New field.
	* java/io/ObjectOutputStream.java (writeFields): Call
	osc.ensureFieldsSet().

	* java/io/ObjectInputStream.java (parseContent): Assign the handle
	for a PROXYCLASSDESC immediately after reading the marker.

From-SVN: r124187
This commit is contained in:
Andrew Haley 2007-04-26 14:31:29 +00:00
parent 02cba8dfe4
commit 5c12b59bd8
15 changed files with 46 additions and 2 deletions

View file

@ -1211,11 +1211,17 @@ public class ObjectOutputStream extends OutputStream
}
/* GCJ LOCAL */
// writes out FIELDS of OBJECT for the specified ObjectStreamClass.
// FIELDS are already in canonical order.
// FIELDS are already supposed already to be in canonical order, but
// under some circumstances (to do with Proxies) this isn't the
// case, so we call ensureFieldsSet().
private void writeFields(Object obj, ObjectStreamClass osc)
throws IOException
{
osc.ensureFieldsSet(osc.forClass());
/* END GCJ LOCAL */
ObjectStreamField[] fields = osc.fields;
boolean oldmode = setBlockDataMode(false);