[ 
http://jira.jboss.com/jira/browse/JBAS-1579?page=comments#action_12316392 ]
     
Clebert Suconic commented on JBAS-1579:
---------------------------------------

I didn't know there is another testcase doing something to serialUIDs. When I 
saw JBAS-1598 I understood I needed to verify serialUIDs.

Well... let's talk about the differences.

First difference:
I'm checking if every class into a given JAR has implemented serialUID.
I'm doing that by getField/introspection.

As it's a private field, I'm changing the property in the same way 
ObjectOutputStream does:

Field field = parameterClass.getDeclaredField("serialVersionUID");
field.setAccessible(true);


Second difference:
If you add older versions in a configured directory (through a property in the 
system... good option for cruisecontrol), I will check if all the older 
versions also have serialUID defined.

Them I'm checking if both are the same.


Third difference:
If I have a default constructor, I'm serializing the Object using the older 
versions in the configured directory. 
I deserialize in the current version using ObjectInputStreamWithClassLoader.


Forth difference:
You will see every class tested as a TestResult. Fancy feature only

I'm attaching the sourcecode, as I will commit it after validated.


> Need to cleanup the serialVersionUIDs for Serializable/Externalizable classes
> -----------------------------------------------------------------------------
>
>          Key: JBAS-1579
>          URL: http://jira.jboss.com/jira/browse/JBAS-1579
>      Project: JBoss Application Server
>         Type: Bug
>     Versions:  JBossAS-4.0.2RC1,  JBossAS-4.0.1 SP1
>     Reporter: Scott M Stark
>     Assignee: Clebert Suconic
>     Priority: Blocker
>      Fix For: JBossAS-4.0.2 Final
>  Attachments: SerializableHasSerialVersionUIDField.zip, TestResultSample.zip
>
>
> I'm seeing incomptibilities between versions that are simply due to the fact 
> that Serializable/Externalizable classes are letting their serialVersionUIDs 
> float instead of explicitly defining them. We need to get this cleaned up. 
> There should not be a single Serializable/Externalizable class that does not 
> fix its serialVersionUID and then take responsibility for maintaining 
> compatibility with the indicated version.
> The attached SerializableHasSerialVersionUIDField.zip unzips to create a 
> SerializableHasSerialVersionUIDField-index.html and 
> SerializableHasSerialVersionUIDField directory which is a report of all 
> classes in the 4.0 codebase that are not defining a serialVersionUID as they 
> should. 
> The JDK object serialization spec defines all you need to know about the apis 
> and contracts for object serialization:
> http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/serialTOC.html
> In particular, Versioning of Serializable Objects:
> http://java.sun.com/j2se/1.4.2/docs/guide/serialization/spec/version.html#wp9419
> talks about binary compatibility and what is available to manage this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.jboss.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005
Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows
Embedded(r) & Windows Mobile(tm) platforms, applications & content.  Register
by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to