[kaffe] Problem with deserialization

Mattias Rehnberg Mattias.Rehnberg at home.se
Wed Oct 20 16:42:19 PDT 2004


Hello,

I have trouble deserializing a class that inherits from a serialized class with member variables with Kaffe, like SerializedSub:

static class SerializedBase implements Serializable {
int count = 0;

public SerializedBase() {}
}

static class SerializedSub extends SerializedBase {
           
public SerializedSub() {}
    	
}

During deserialization, Kaffe seems to set the variable in the object using only variable (slot) information, i e if SerializedSub would have an int x member, x would be set to count (but overwritten with x just after). I solved this by passing the class on together with the object all the way down to getFieldAddress in ObjectInputStream.c, which I modified to work as Field in reflect. Can anyone say if this is the proper way to do it?

/Mattias





More information about the kaffe mailing list