XmlModuleDescriptorWriterTest is broken
---------------------------------------

                 Key: IVY-374
                 URL: https://issues.apache.org/jira/browse/IVY-374
             Project: Ivy
          Issue Type: Bug
    Affects Versions: 1.4.1
            Reporter: Stephane Bailliez
            Priority: Minor
             Fix For: 1.5


XmlModuleDescriptorWriterTest is using pure String comparison of serialized 
module descriptor.

>From a quick look, this does not work as it relies on ordering of values 
>within a HashMap so it can only work if the ordering of the hashmap is the 
>same as the one that was done when serializing the file used for reference.

So if you try running the test with Sun JDK 6 it will fail while it will work 
with Sun JDK 5 since the hash method used as a default has been changed. 

To fix it as I can see right now:
1) you guarantee ordering and sort each element (lexicographically ?) within 
XmlModuleDescriptorWriter when serializing things
2) you don't guarantee ordering but you implement equals method for 
DefaultModuleDescriptor (which I assume will have a cascading effect for other 
classes)

I think 1) makes more sense for now and we should go toward 2) so that more 
comparisons of objects can be done using equals() (esp. as there are a lot of 
objects that end up in maps)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to