[dna-issues] [JBoss JIRA] Resolved: (DNA-551) graph.Location's equals(Object) and hashCode() Methods Are Not Consistent

Randall Hauch (JIRA) jira-events at lists.jboss.org
Wed Nov 25 15:19:29 EST 2009


     [ https://jira.jboss.org/jira/browse/DNA-551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Randall Hauch resolved DNA-551.
-------------------------------

    Resolution: Done
      Assignee: Johnny Verhaeg


Applied the second version of the patch ('DNA-551-patch2.txt'), after all unit and integration tests passed.  Basically, the Location.equals(...) and Location.isSame(...) method behaviors were switched, and the various uses corrected.  Now, the Location.equals(...) and Location.hashCode() methods behave in the traditional way, and can be used as keys in Maps (even when you might have partial Location objects and the Map might contain actual Location objects, or vice versa). 

> graph.Location's equals(Object) and hashCode() Methods Are Not Consistent
> -------------------------------------------------------------------------
>
>                 Key: DNA-551
>                 URL: https://jira.jboss.org/jira/browse/DNA-551
>             Project: DNA
>          Issue Type: Bug
>          Components: Graph
>    Affects Versions: 0.6
>            Reporter: Dan Florian
>            Assignee: Johnny Verhaeg
>            Priority: Blocker
>             Fix For: 0.7
>
>         Attachments: DNA-551-patch1.txt, DNA-551-patch2.txt
>
>
> Location.hashCode() and Location.equals(Object) need to be consistent. The current implementation of the base class and subclasses prevent logically equal locations (same path or same ID properties) from being used java.util.Map objects.
> It should be true that if one subtype of Location has the same path as a different subtype of Location, and only one of these objects has ID properties, those locations should be equal and should have the same hashCode.

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

        


More information about the dna-issues mailing list