This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: Object serialization patch
- From: "Jeroen Frijters" <jeroen at sumatra dot nl>
- To: "Guilhem Lavaux" <guilhem at kaffe dot org>
- Cc: <classpath at gnu dot org>,<java-patches at gcc dot gnu dot org>
- Date: Tue, 24 Feb 2004 10:52:57 +0100
- Subject: RE: Object serialization patch
Guilhem Lavaux wrote:
> The problem if you sort fields using
> ObjectStreamField.compareTo is that you separate names which
> are alphabetically sorted. I will explain this on the
> following example.
[...explanation deleted...]
Thanks for explaining it! Now it makes sense and the patch looks good to
me.
> Yes, I'm also not completely satisfied with this method. But
> there exists cases where it is needed. For example, if
> serialPersistentFields declares class types wrongly. The
> types are not checked previously in that case and this
> results in an IllegalArgumentException (which is wrong). The
> solution would be to check the types of all fields when we
> are building the ObjectStreamClass from serialPersistentFields.
Yes, that would definitely be better. Looking at it again, I think that
the check in setObjectField might be wrong. I'm not sure, but there
might be class loader issues (two classes with the same name, but loaded
by a different class loader) and I think it is legal to change the type
of a field to a super class.
Regards,
Jeroen