Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C10E7200CA8 for ; Thu, 15 Jun 2017 14:50:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BFA14160BC4; Thu, 15 Jun 2017 12:50:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 12117160BED for ; Thu, 15 Jun 2017 14:50:06 +0200 (CEST) Received: (qmail 25835 invoked by uid 500); 15 Jun 2017 12:50:06 -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 25823 invoked by uid 99); 15 Jun 2017 12:50:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Jun 2017 12:50:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E3696CFE96 for ; Thu, 15 Jun 2017 12:50:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.211 X-Spam-Level: X-Spam-Status: No, score=-99.211 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id XotsR0FQozEV for ; Thu, 15 Jun 2017 12:50:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4FE365F6D3 for ; Thu, 15 Jun 2017 12:50:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 90337E0C1B for ; Thu, 15 Jun 2017 12:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4746121D8F for ; Thu, 15 Jun 2017 12:50:00 +0000 (UTC) Date: Thu, 15 Jun 2017 12:50:00 +0000 (UTC) From: "Hang Park (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (MATH-1419) Invalid usage of exception in PolynomialSplineFunction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 15 Jun 2017 12:50:07 -0000 [ https://issues.apache.org/jira/browse/MATH-1419?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16050411#comment-16050411 ] Hang Park edited comment on MATH-1419 at 6/15/17 12:49 PM: ----------------------------------------------------------- [~erans] Oh, I just made a PR right before.. at [https://github.com/apache/commons-math/pull/62], duplicated. But, you should also change order of string format position in English and French! I made it, so check above PR. Thanks! was (Author: hangpark): [~erans] Oh, I just made a PR right before.. at [https://github.com/apache/commons-math/pull/62|https://github.com/apache/commons-math/pull/62], duplicated. But, you should also change order of string format position in English and French! I made it, so check above PR. Thanks! > Invalid usage of exception in PolynomialSplineFunction > ------------------------------------------------------ > > Key: MATH-1419 > URL: https://issues.apache.org/jira/browse/MATH-1419 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.6.1 > Reporter: Hang Park > Priority: Trivial > Labels: easyfix > Fix For: 4.0 > > Original Estimate: 10m > Remaining Estimate: 10m > > In PolynomialSplineFunction constructor, it tests whether length of knots is smaller than 2 or not. If <2, it throws NumberIsTooSmallException like below: > {code:java} > if (knots.length < 2) { > throw new NumberIsTooSmallException(LocalizedFormats.NOT_ENOUGH_POINTS_IN_SPLINE_PARTITION, > 2, knots.length, false); > } > {code} > But definition of above exception has parameters of the form: > {code:java} > /** > * Construct the exception with a specific context. > * > * @param specific Specific context pattern. > * @param wrong Value that is smaller than the minimum. > * @param min Minimum. > * @param boundIsAllowed Whether {@code min} is included in the allowed range. > */ > public NumberIsTooSmallException(Localizable specific, > Number wrong, > Number min, > boolean boundIsAllowed) { > super(specific, wrong, min); > this.min = min; > this.boundIsAllowed = boundIsAllowed; > } > {code} > h3. In my opinion, *2, knots.length, false* should be *knots.length, 2, true* > since 2 is the minimum value and knots.length is the wrong value in this case. Moreover, boolean should be set by true because 2 is also acceptable. -- This message was sent by Atlassian JIRA (v6.4.14#64029)