commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Neidhart (JIRA)" <>
Subject [jira] [Commented] (MATH-786) "hashCode" in "Pair" class
Date Mon, 07 May 2012 10:21:49 GMT


Thomas Neidhart commented on MATH-786:

Do you have a use case at hand that requires this change?

In general, I would oppose something like that as it sounds like premature optimization.
Although documenting the behavior in javadoc is correct, it may still create problems and
makes debugging more difficult.

OTOH, if the default is "false" and only set explicitly to "true" in specific cases where
a user / developer knows exactly what he/she is doing it would be fine I guess.
> "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