[
https://issues.apache.org/jira/browse/MATH-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928821#action_12928821
]
Gilles commented on MATH-432:
-----------------------------
Since we don't make _copies_ of the key and value passed to the constructor,
the references are shared by the arguments and the instances variables of the
newly-created {{Pair}}. Assuming that the object is immutable (and documenting
it as such) may thus give a false sense of safety.
Is changing the code still worth it?
> Create a "Pair" class
> ---------------------
>
> Key: MATH-432
> URL: https://issues.apache.org/jira/browse/MATH-432
> Project: Commons Math
> Issue Type: New Feature
> Reporter: Gilles
> Assignee: Gilles
> Fix For: 3.0
>
>
> The {{AbstractMap.SimpleEntry}} implementation of {{Map.Entry<K,V>}} is only
> available in Java 1.6+.
> I propose to create a class Pair<K,V> to be used as a replacement.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.