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 537321145A for ; Wed, 9 Jul 2014 19:25:08 +0000 (UTC) Received: (qmail 90873 invoked by uid 500); 9 Jul 2014 19:25:08 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 90786 invoked by uid 500); 9 Jul 2014 19:25:08 -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 90571 invoked by uid 99); 9 Jul 2014 19:25:08 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jul 2014 19:25:08 +0000 Date: Wed, 9 Jul 2014 19:25:07 +0000 (UTC) From: "Benedikt Ritter (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (LANG-1016) NumberUtils#isParsable method(s) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LANG-1016?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Benedikt Ritter resolved LANG-1016. ----------------------------------- Resolution: Fixed Fix Version/s: (was: Discussion) (was: Review Patch) 3.4 {code} bene@localhost:~/workspace/apache/commons/lang$ svn ci -m "LANG-1016: Numbe= rUtils#isParsable method(s). Thanks to Juan Pablo Santos Rodr=C3=ADguez." Sending src/changes/changes.xml Sending src/main/java/org/apache/commons/lang3/math/NumberUtils.java Sending src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.= java Transmitting file data ... Committed revision 1609273. {code} I've changed the method name from {{isParseable}} to {{isParsable}} because= according to http://en.wiktionary.org/wiki/parsable this is preferred in f= ormal usage. Thanks!=20 > NumberUtils#isParsable method(s) > -------------------------------- > > Key: LANG-1016 > URL: https://issues.apache.org/jira/browse/LANG-1016 > Project: Commons Lang > Issue Type: Wish > Components: lang.math.* > Reporter: Juan Pablo Santos Rodr=C3=ADguez > Assignee: Benedikt Ritter > Fix For: 3.4 > > Attachments: LANG-1016.patch > > > (for background see [LANG-997|https://issues.apache.org/jira/browse/LANG-= 997?focusedCommentId=3D13991193&page=3Dcom.atlassian.jira.plugin.system.iss= uetabpanels:comment-tabpanel#comment-13991193]) > It would be nice to have an {{isParseable}} method (or whatever it may be= called), to be able to identify valid (=3Dparseable) Numbers, something al= ong the lines {{toDouble(String)}} / {{toLong(String)}} etc., but returning= {{true}} / {{false}} while avoiding at the same time the {{try/catch(Numbe= rFormatException)}} of those methods. > This method would be similar to {{isNumber}}, but it should yield {{true}= } for invalid octals like "018" which are parseable as Numbers. The point o= f this method is to identify "human" (neither hex nor octal, but should han= dle decimal points) numbers stored as Strings,=20 > We are using NumberUtils#isNumber to identify valid (parseable, human) nu= mbers, but as of 3.3, this method also handles octal numbers, so, f.ex., 0= 18, which was recognized as a valid number, isn't recognized anymore as one= . -- This message was sent by Atlassian JIRA (v6.2#6252)