You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2015/10/18 20:13:05 UTC

[jira] [Commented] (MATH-1281) "Median" should not extend "Percentile"

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

Phil Steitz commented on MATH-1281:
-----------------------------------

Agreed this should be fixed in 4 - i.e., there should be no inheritance.  We can start by moving to delegation and then consider better optimized alternatives.

> "Median" should not extend "Percentile"
> ---------------------------------------
>
>                 Key: MATH-1281
>                 URL: https://issues.apache.org/jira/browse/MATH-1281
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.5
>            Reporter: Gilles
>            Priority: Minor
>             Fix For: 4.0, 3.6
>
>
> Class {{Median}} (package {{o.a.c.m.stat.descriptive.rank}} inherits several {{evaluate}} methods from {{Percentile}} where one of the arguments is the percentile value. That doesn't make sense, and easily allows for user bugs.
> Either those inherited methods should be overridden by methods that throw a "forbidden" exception, or perhaps more correctly (but not backwards-compatible), the methods with a specific percentile argument should be made "static". The latter would also fix the same problem in the {{Percentile}} class itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)