classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object serialization patch


From: Guilhem Lavaux
Subject: Re: Object serialization patch
Date: Mon, 23 Feb 2004 14:17:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Jeroen Frijters wrote:

Hi,

Thanks for the patch.

I have one question.

            int comp_val =
-               real_fields[real_idx].compareTo
(stream_fields[stream_idx]);
+               real_fields[real_idx].getName().compareTo
(stream_fields[stream_idx].getName());

By my reading of the spec, primitive fields are written before reference
fields, it's not simply sorted by name. See
http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/class.doc3.ht
ml
Right. I've forgotten this problem. This was introduced to fix a specific problem when you have inconsistencies between the field descriptors from the stream and from the class definition.
For example, if you have:

class A { String x; }

and in the stream you have 'int x' the former behaviour was not able to detect the inconsistency and was creating a new duplicate field 'int x'. So maybe we should check this before the main loop by first comparing fields by name and then merging the two tables.

Regards,
Guilhem.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]