[ 
https://issues.apache.org/jira/browse/MATH-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059132#comment-13059132
 ] 

Dave Brosius commented on MATH-610:
-----------------------------------

feel free to ignore if you don't want it, altho i don't like relying on an api 
only using compareTo from now to eternity, as opposed to equals as well, as 
various JDK methods have switched back and forth over various implementations. 
The hashCode is fine, as the only requirement for hashCode is if two objects 
are equal, then their hashCode must be the same, which this implementation 
provides.

however, as stated, feel free to ignore.

> [patch] objects that use compareTo should have equals as well
> -------------------------------------------------------------
>
>                 Key: MATH-610
>                 URL: https://issues.apache.org/jira/browse/MATH-610
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 3.0
>
>         Attachments: equals.diff
>
>
> NaturalRanking implements compareTo. Code that implements compareTo should 
> also implement equals, and those that implement equals should implement 
> hashCode. This patch does this.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to