This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]