ObjectOutputStream.java (writeObject): Use component type when writing arrays.

* java/io/ObjectOutputStream.java (writeObject): Use component type
	when writing arrays.
	Fixed typo.

From-SVN: r34142
This commit is contained in:
Warren Levy 2000-05-24 21:15:51 +00:00 committed by Warren Levy
parent ba34d877f6
commit 0d0cd44169
2 changed files with 9 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2000-05-24 Warren Levy <warrenl@cygnus.com>
* java/io/ObjectOutputStream.java (writeObject): Use component type
when writing arrays.
Fixed typo.
2000-05-20 Bryce McKinlay <bryce@albatross.co.nz> 2000-05-20 Bryce McKinlay <bryce@albatross.co.nz>
Fix for PR libgcj/226: Fix for PR libgcj/226:

View file

@ -1,5 +1,5 @@
/* ObjectOutputStream.java -- Class used to write serialized objects /* ObjectOutputStream.java -- Class used to write serialized objects
Copyright (C) 1998, 1999 Free Software Foundation, Inc. Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -276,7 +276,7 @@ public class ObjectOutputStream extends OutputStream
realOutput.writeByte (TC_ARRAY); realOutput.writeByte (TC_ARRAY);
writeObject (osc); writeObject (osc);
assignNewHandle (obj); assignNewHandle (obj);
writeArraySizeAndElements (obj, clazz); writeArraySizeAndElements (obj, clazz.getComponentType ());
break; break;
} }
@ -395,7 +395,7 @@ public class ObjectOutputStream extends OutputStream
throw new NotActiveException ("defaultWriteObject called by non-active class and/or object"); throw new NotActiveException ("defaultWriteObject called by non-active class and/or object");
if (fieldsAlreadyWritten) if (fieldsAlreadyWritten)
throw new IOException ("Only one of putFields and defalutWriteObject may be called, and it may only be called once"); throw new IOException ("Only one of putFields and defaultWriteObject may be called, and it may only be called once");
fieldsAlreadyWritten = true; fieldsAlreadyWritten = true;
} }