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

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

GitHub user chtompki opened a pull request:

    https://github.com/apache/commons-lang/pull/186

    LANG-1252: rename isNumber, isCreatable. Accommodate for java 6 "+" handing.

    Associated with: https://issues.apache.org/jira/browse/LANG-1252
    
    @britter, do you have any thoughts on this. I think that it sufficiently 
covers the issue, but I wasn't sure about the mechanics about predicating 
functionality on java version. The main issue is that `new 
java.math.BigInteger("+2")` works for Java 1.7 and up, but not in Java 1.6. On 
the other hand `java.math.Float.valueOf("+2.0")` works on all versions of java. 
So I tried to accommodate for that in the `isCreatable` method.
    
    Based on your email about releases and my being slightly deadline driven 
person, I figured I'd try to put something reasonable together for the 3.5 
release candidate. That said, if the diff on the PR doesn't look solid enough, 
I'm willing to work on the changes some more.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chtompki/commons-lang LANG-1252

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/186.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #186
    
----
commit c503d742f094dc2048b72c3f78f5e2e6070a44e1
Author: Rob Tompkins <[email protected]>
Date:   2016-09-11T01:01:08Z

    LANG-1252: better naming and java 6 specifics around handling a leading +

commit 0a0a35f54f5e7ab2d10022d3ee244cbc876bdde2
Author: Rob Tompkins <[email protected]>
Date:   2016-09-11T01:07:42Z

    LANG-1252: updates to package-info, adding name to pom.xml

----


> 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)

Reply via email to