commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LANG-1252) NumberUtils.isNumber and NumberUtils.createNumber resolve inconsistently
Date Sun, 11 Sep 2016 12:13:20 GMT

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

ASF GitHub Bot commented on LANG-1252:
--------------------------------------

Github user britter commented on a diff in the pull request:

    https://github.com/apache/commons-lang/pull/186#discussion_r78293625
  
    --- Diff: src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java ---
    @@ -1216,91 +1217,104 @@ public void testIsDigits() {
         }
     
         /**
    -     * Tests isNumber(String) and tests that createNumber(String) returns
    -     * a valid number iff isNumber(String) returns false.
    +     * Tests isCreatable(String) and tests that createNumber(String) returns
    +     * a valid number iff isCreatable(String) returns false.
          */
         @Test
    -    public void testIsNumber() {
    -        compareIsNumberWithCreateNumber("12345", true);
    --- End diff --
    
    Don't remove this tests. Although we have deprecated `isNumber` we will probably have
to maintain the code for a while before it can be dropped in Lang 4.0


> NumberUtils.isNumber and NumberUtils.createNumber resolve inconsistently
> ------------------------------------------------------------------------
>
>                 Key: LANG-1252
>                 URL: https://issues.apache.org/jira/browse/LANG-1252
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.math.*
>    Affects Versions: 3.4
>            Reporter: Rob Tompkins
>            Assignee: Rob Tompkins
>             Fix For: Discussion
>
>
> In considering the issues LANG-1060, LANG-1040, LANG-1038, and LANG-992, it seems that
there are times when {{NumberUtils.isNumber}} resolves to {{false}} while {{NumberUtils.createNumber}},
given the same input, does not throw an exception, returning a valid {{java.lang.Number}}.
This inconsistency should be resolved either by making {{isNumber}} more lenient or {{createNumber}}
more stringent.



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

Mime
View raw message