commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (MATH-786) "hashCode" in "Pair" class
Date Thu, 10 May 2012 00:54:48 GMT


Sebb commented on MATH-786:

bq. if you need to cache the hashcode values, just do it in the types that you put in the
bq. This "optimization" is in the wrong place, it should be left to the participating types

Very good points.

I'm inclined to agree with James here.
But if it is decided to keep the feature, then the Javadoc must be clarified.
> "hashCode" in "Pair" class
> --------------------------
>                 Key: MATH-786
>                 URL:
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.0
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Trivial
>             Fix For: 3.1
> Since "Pair" is supposed to be an immutable class, couldn't we cache the "hashCode" value
at construction? That would supposedly make it more efficient when used in maps.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message