RE: Object serialization patch

2004-02-23 Thread Jeroen Frijters
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

Re: Object serialization patch

2004-02-23 Thread Guilhem Lavaux
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 fie

Re: Object serialization patch

2004-02-23 Thread Guilhem Lavaux
Hi, Here is a new patch I propose. I've taken the suggestion into account and fix another small error reporting problem. New changelog entry: 2004-02-23 Guilhem Lavaux <[EMAIL PROTECTED]> * libraries/javalib/java/io/ObjectInputStream.java (readClassDescriptor): Fixed f

RE: Object serialization patch

2004-02-23 Thread Jeroen Frijters
Hi, > Here is a new patch I propose. I've taken the suggestion > into account and fix another small error reporting problem. I don't understand checkTypeConsistency, it looks odd and I'm having a hard time believing that it is correct. BTW, Shouldn't "nonPrimitive" be named "primitive"? Also,

Re: Object serialization patch

2004-02-23 Thread Guilhem Lavaux
Jeroen Frijters wrote: Hi, Here is a new patch I propose. I've taken the suggestion into account and fix another small error reporting problem. I don't understand checkTypeConsistency, it looks odd and I'm having a hard time believing that it is correct. BTW, Shouldn't "nonPrimitive" be named

RE: Object serialization patch

2004-02-24 Thread Jeroen Frijters
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 g

Re: Object serialization patch

2004-02-24 Thread Guilhem Lavaux
Jeroen Frijters wrote: Guilhem Lavaux wrote: 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 Illegal

RE: Object serialization patch

2004-02-25 Thread Jeroen Frijters
Guilhem Lavaux wrote: > In that case I'm proposing this patch. I have replaced the > type checks in setXXXField by a type check in > ObjectStreamClass.setClass by invoking a new method > ObjectStreamField.checkFieldType. Here I'm only checking > that the field is really assignable with a value