You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Xavier Hanin (JIRA)" <ji...@apache.org> on 2007/03/26 14:40:32 UTC

[jira] Assigned: (IVY-374) XmlModuleDescriptorWriterTest is broken

     [ https://issues.apache.org/jira/browse/IVY-374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Hanin reassigned IVY-374:
--------------------------------

    Assignee: Xavier Hanin

> 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
>         Assigned To: Xavier Hanin
>            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.
-
You can reply to this email to add a comment to the issue online.