[kaffe] [PATCH] deserialization with fields in superclass

Noa Resare noa at resare.com
Sat Oct 23 13:18:50 PDT 2004


Kaffe currently doesn't deserialize fields in superclasses correctly at
the moment which breaks for example the mauve
gnu.testlet.java.io.ObjectInputOutput.SerTest test.

It turns out that when a class is deserialized the fields of it's
superclasses needs to be filled in by a funcation
(java_io_VMObjectStreamClass_set*Native in
libraries/clib/io/ObjectInputStream.c) that takes a class argument and a
java.lang.reflect.Field argument. The class argument is always set to
the class being serialized so to correctly fill in fields in any
superclasses we need to look at the value of Field.getDeclaringClass()
to find it.

Since the current code in ObjectInputStream.c doesn't use JNI method
invocation i have taken the liberty to use the Field member clazz
directly. In the long run I think it would be better to adopt the
classpath code but for now this works.

This brings down the number of mauve regressions to 2.

/noa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kaffe-deserialize.patch
Type: text/x-patch
Size: 1225 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/20041023/2a731c3f/attachment-0002.bin 


More information about the kaffe mailing list