Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3FF531740C for ; Sun, 12 Apr 2015 19:10:13 +0000 (UTC) Received: (qmail 70124 invoked by uid 500); 12 Apr 2015 19:10:13 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 70020 invoked by uid 500); 12 Apr 2015 19:10:12 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 69922 invoked by uid 99); 12 Apr 2015 19:10:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Apr 2015 19:10:12 +0000 Date: Sun, 12 Apr 2015 19:10:12 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MATH-1205) AbstractStorelessUnivariateStatistic should not extend AbstractUnivariateStatistic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-1205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Thomas Neidhart updated MATH-1205: ---------------------------------- Attachment: (was: MATH-1205.patch) > AbstractStorelessUnivariateStatistic should not extend AbstractUnivariateStatistic > ---------------------------------------------------------------------------------- > > Key: MATH-1205 > URL: https://issues.apache.org/jira/browse/MATH-1205 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.4.1 > Reporter: Thomas Neidhart > > For a storeless statistic it is wrong to extend AbstractUnivariateStatistic as various fields and methods are inherited that do not make sense in case of a storeless statistic. > This means a user can accidentially use a storeless statistic in a wrong way: > {code} > Mean mean = new Mean(); > > mean.increment(1); > mean.increment(2); > > mean.setData(new double[] { 1, 2, 3}); > > System.out.println(mean.getResult()); > System.out.println(mean.evaluate()); > {code} > will output > {noformat} > 1.5 > 2.0 > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)