[
https://issues.apache.org/jira/browse/MATH-610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13059128#comment-13059128
]
Phil Steitz commented on MATH-610:
----------------------------------
I am not sure this is really necessary, as IntDoublePair is a private inner
class and as the javadoc states, CompareTo is only implemented so Arrays.sort
can be used. I think the patch also contains an error - the hash should use
the double, not int value. In any case, we would have to add tests and I am
not sure it really improves NaturalRanking to do this.
> [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