[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Object serialization patch
From: |
Jeroen Frijters |
Subject: |
RE: Object serialization patch |
Date: |
Tue, 24 Feb 2004 10:52:57 +0100 |
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