commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From EP...@upstate.com
Subject RE: [LANG] Possible bug on NumberUtils.isNumber()?
Date Thu, 05 Jun 2003 12:59:18 GMT
Here is a patch for 

Attached is a patch file for NumberUtilsTest.  It just adds
       
        val = "1a";
        assertTrue("isNumber(String) 15 Neg failed",
!NumberUtils.isNumber(val));
        assertTrue("isNumber(String)/createNumber(String) 15 Neg failed",
!checkCreateNumber(val));

to the isNumber testcase.

Eric Pugh

-----Original Message-----
From: EPugh@upstate.com [mailto:EPugh@upstate.com]
Sent: Thursday, June 05, 2003 8:47 AM
To: commons-dev@jakarta.apache.org
Subject: [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


Mime
View raw message