commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sébastien Brisard (JIRA) <>
Subject [jira] [Commented] (MATH-786) "hashCode" in "Pair" class
Date Sat, 05 May 2012 14:01:50 GMT


Sébastien Brisard commented on MATH-786:

Is there really a way to make {{Pair}} immutable?
How about we write a big warning in the Javadoc that it is the reponsibility of the user to
make sure that objects passed to {{Pair}} are immutable.
I think we _must_ trust the user on this particular problem. As for internal uses of {{Pair}}
it is _our_ responsibility... I think we can take care of that!!!
> "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