RE: JSR 160 is FINAL !
Brian Scully <[email protected]>
| Newsgroups | gmane.comp.java.mx4j.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, --- "Bordet, Simone" <[email protected]> wrote: > Hi, > > > I've replaced these with instantiations - but the > > serialization verifier tries to serialize an > object > > with one version of a class and deserialize it > with > > another. This will fail every time. > > That's strange. > The serialization stuff works fine with all JSR 3 > classes, it is only a matter of having the > Comparator implemented correctly, unless I am > totally off road here. What I am seeing is different SerialVersionUIDs (which will cause the default implementation of the ObjectInputStream to choke). I have been reading the serialization spec: http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/serialTOC.html. This UID is computed from a SHA hash of the following aspects of a class: 1) Class name 2) Class modifiers 3) Name of each interface sorted by name 4) For each field (except private static and private transient fields) a) name of field b) modifiers of field c) descriptor of field 5) If class initializer exists a) <clinit> b) modifier (static) c) descriptor ()V 6) For each non-private constructor a) <init> b) modifiers c) descriptor 7) For each non-private method a) name of method b) modifiers c) descriptor This suggests to me that we have some differences between our classes (9/26 tested) and the RI classes. The plan is to walk through these class by class - but are there any implications for me looking at the RI source code and working on the MX4J source code? I haven't read Sun's source license for this one yet, but I can't imagine that it's extremely open on this point. Opinions or experiences? > Before writing something new, take a look at how the > tests for JSR 3 work. > They should be very very similar for JSR 160. Given > that, it should be sufficient to implement the > RemoteInstantiator and the RemoteComparator. The > rest should do the job. > In fact, the serialization tests for the JSR 160 > part inherit from the one of the JSR 3 part. I looked into the serialization tests for the JSR 3 (non remote) classes - and they do look very similiar. There may have been an exercise to compare and address the possibility of non-private fields or methods added to (or not reflected in) the MX4J implementation of JSR3. Brian __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/