re PR libgcj/1971 (ObjectOutputStream generates incorrect serialVersionUID's for array classes)

* java/io/ObjectStreamClass.java (setUID): Don't write interface
	info for array classes.
	Fixes PR libgcj/1971.

From-SVN: r40337
This commit is contained in:
Tom Tromey 2001-03-09 01:35:54 +00:00 committed by Tom Tromey
parent bb6852eb72
commit 6771219aaa
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2001-03-08 Tom Tromey <tromey@redhat.com>
* java/io/ObjectStreamClass.java (setUID): Don't write interface
info for array classes.
Fixes PR libgcj/1971.
2001-03-06 Bryce McKinlay <bryce@albatross.co.nz>
* java/util/TreeSet.java (writeObject): Use a for-loop instead of

View File

@ -444,11 +444,15 @@ public class ObjectStreamClass implements Serializable
| Modifier.INTERFACE | Modifier.PUBLIC);
data_out.writeInt (modifiers);
Class[] interfaces = cl.getInterfaces ();
Arrays.sort (interfaces, interfaceComparator);
for (int i=0; i < interfaces.length; i++)
data_out.writeUTF (interfaces[i].getName ());
// Pretend that an array has no interfaces, because when array
// serialization was defined (JDK 1.1), arrays didn't have it.
if (! cl.isArray ())
{
Class[] interfaces = cl.getInterfaces ();
Arrays.sort (interfaces, interfaceComparator);
for (int i=0; i < interfaces.length; i++)
data_out.writeUTF (interfaces[i].getName ());
}
Field field;
Field[] fields = cl.getDeclaredFields ();