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
2 changed files with 15 additions and 5 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue