[ 
https://issues.apache.org/jira/browse/MATH-261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699193#action_12699193
 ] 

Luc Maisonobe commented on MATH-261:
------------------------------------

I don't get it.

The "(T) obj" versus "v" issue is only a syntax issue. If the underlying 
behavior won't work for Integer instances, then it won't work whatever syntax 
is used.
In both case the object put in the map is already an instance of T (or one of 
its subclasses). In both cases the instance that is put in the map will retain 
its value because neither the first nor the second cast do really trigger any 
data conversion. The first cast (from T to Object) only "anonymizes" the v 
parameter. The second cast (from Object to T) forces it back to its original 
type. I even think no copy is made and the two references (v and obj) point to 
the same instance.

Well, it is really a minor issue, so I'll stop arguing. Just do as you want, I 
won't mind.

Considering the more important overall goal of the patch, since Phil considers 
the mixing types feature is an useful feature then of course we should preserve 
it. So ignore my previous concerns about it and apply the patch when you are 
happy with it, at least making sure non-eclipse compilers don't choke on it.

> Add generics to Frequency
> -------------------------
>
>                 Key: MATH-261
>                 URL: https://issues.apache.org/jira/browse/MATH-261
>             Project: Commons Math
>          Issue Type: Improvement
>            Reporter: Sebb
>             Fix For: 2.0
>
>         Attachments: Frequency.patch
>
>
> I've attempted to add generics to Frequency.
> This requires a minor change to the API, in that Objects to be used with the 
> class need to be Comparable.
> This will break some code, e.g. one change was needed to the test cases.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to