[kaffe] Serialization

Guilhem Lavaux guilhem@kaffe.org
Sun Aug 10 08:14:02 2003


Hi,

I nearly managed to get Classpath's serialization up to kaffe's level=20
and at the
same time keeping the advantage of it. However, it is "nearly". As I said=
 to
Mark Wielaard, kaffe's regression tests TestSerialVersions.Test0007,=20
Test0009,
Test0010, Test0011, Test0013 fails; but also TestSerialFields.Test0010 an=
d
Test0015. These tests are problematic because it seems the field=20
serialPersistentFields
has an effect on the deserialization. The specification is not really=20
clear for that
point although all documentation I came across says=20
serialPersistentFields is normally only used
for serialization. I checked JDK: except for one test, its output is the=20
same
as the expected one (which means kaffe's previous implementation was righ=
t
except for one test).

What is your opinion on that ? The spec of serialization says:
"By using |serialPersistentFields| to define the Serializable fields for=20
a class,
there no longer is a limitation that a serializable field must be a=20
field within
the current definition of the |Serializable| class. The |writeObject|=20
and |readObject|
methods of the |Serializable| class can map the current implementation=20
of the
class to the serializable fields of the class using the interface that=20
is described
in Section 1.7 "Accessing Serializable Fields of a Class
<http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/serial-arch=
.html#wp5253>.=94
Therefore, the fields for a |Serializable| class can change in a later=20
release, as
long as it maintains the mapping back to its Serializable fields that=20
must remain
compatible across release boundaries."

However I cam across an RMI's documentation which says=20
serialPersistentFields should
only be used for writing objects and not reading them.

So ?

Cheers,
Guilhem.