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:
parent
bb6852eb72
commit
6771219aaa
@ -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>
|
2001-03-06 Bryce McKinlay <bryce@albatross.co.nz>
|
||||||
|
|
||||||
* java/util/TreeSet.java (writeObject): Use a for-loop instead of
|
* java/util/TreeSet.java (writeObject): Use a for-loop instead of
|
||||||
|
@ -444,11 +444,15 @@ public class ObjectStreamClass implements Serializable
|
|||||||
| Modifier.INTERFACE | Modifier.PUBLIC);
|
| Modifier.INTERFACE | Modifier.PUBLIC);
|
||||||
data_out.writeInt (modifiers);
|
data_out.writeInt (modifiers);
|
||||||
|
|
||||||
|
// 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 ();
|
Class[] interfaces = cl.getInterfaces ();
|
||||||
Arrays.sort (interfaces, interfaceComparator);
|
Arrays.sort (interfaces, interfaceComparator);
|
||||||
for (int i=0; i < interfaces.length; i++)
|
for (int i=0; i < interfaces.length; i++)
|
||||||
data_out.writeUTF (interfaces[i].getName ());
|
data_out.writeUTF (interfaces[i].getName ());
|
||||||
|
}
|
||||||
|
|
||||||
Field field;
|
Field field;
|
||||||
Field[] fields = cl.getDeclaredFields ();
|
Field[] fields = cl.getDeclaredFields ();
|
||||||
|
Loading…
Reference in New Issue
Block a user