[jira] Created: (LANG-634) StringUtils.isNumeric returns false on negative value

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (LANG-634) StringUtils.isNumeric returns false on negative value

ASF GitHub Bot (Jira)
StringUtils.isNumeric returns false on negative value
-----------------------------------------------------

                 Key: LANG-634
                 URL: https://issues.apache.org/jira/browse/LANG-634
             Project: Commons Lang
          Issue Type: Bug
          Components: lang.*
    Affects Versions: 2.2
            Reporter: Arjan Moraal


StringUtils.isNumeric returns false for negative values.

So this unit test line will break the test:

                assertTrue(StringUtils.isNumeric("-1"));


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (LANG-634) StringUtils.isNumeric returns false on negative value

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/LANG-634?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Carman closed LANG-634.
-----------------------------

    Resolution: Won't Fix

Check the javadocs:

"Checks if the String contains only unicode digits."

This is not a bug.

> StringUtils.isNumeric returns false on negative value
> -----------------------------------------------------
>
>                 Key: LANG-634
>                 URL: https://issues.apache.org/jira/browse/LANG-634
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 2.2
>            Reporter: Arjan Moraal
>
> StringUtils.isNumeric returns false for negative values.
> So this unit test line will break the test:
> assertTrue(StringUtils.isNumeric("-1"));

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (LANG-634) StringUtils.isNumeric returns false on negative value

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

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

James Carman commented on LANG-634:
-----------------------------------

Try NumberUtils.isNumber().

> StringUtils.isNumeric returns false on negative value
> -----------------------------------------------------
>
>                 Key: LANG-634
>                 URL: https://issues.apache.org/jira/browse/LANG-634
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 2.2
>            Reporter: Arjan Moraal
>
> StringUtils.isNumeric returns false for negative values.
> So this unit test line will break the test:
> assertTrue(StringUtils.isNumeric("-1"));

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.