You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by EP...@upstate.com on 2003/06/05 14:46:57 UTC

[LANG] Possible bug on NumberUtils.isNumber()?

Hi all,

I am checking whether "1b" is a number, and NumberUtils.isNumber() says it
is...  Is the lowercase b mean binary or something?

Here is my testcase:
 public void testNumberUtilsIsNumber()
    {
        String a = "1b";

        assertTrue("1b is not a number!", !NumberUtils.isNumber(a));
     

    }


And here is my error:

Testcase: testNumberUtilsIsNumber took 0 sec
	FAILED
1b is not a number!
junit.framework.AssertionFailedError: 1b is not a number!
	at
com.upstate.commons.utils.comparators.NumberComparatorTestCase.testNumberUti
lsIsNumber(NumberComparatorTestCase.java:319)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:231)


Eric Pugh