commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r1645076 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/math/NumberUtils.java test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
Date Fri, 12 Dec 2014 21:15:19 GMT
Author: mbenson
Date: Fri Dec 12 21:15:18 2014
New Revision: 1645076

URL: http://svn.apache.org/r1645076
Log:
clarify behavior of #isNumber() with blanks

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java?rev=1645076&r1=1645075&r2=1645076&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
Fri Dec 12 21:15:18 2014
@@ -1344,7 +1344,7 @@ public class NumberUtils {
      * <code>false</code>, since <code>9</code> is not a valid octal
value.
      * However, numbers beginning with {@code 0.} are treated as decimal.</p>
      *
-     * <p><code>Null</code> and empty String will return
+     * <p><code>null</code> and empty/blank {@code String} will return
      * <code>false</code>.</p>
      *
      * @param str  the <code>String</code> to check

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java?rev=1645076&r1=1645075&r2=1645076&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
Fri Dec 12 21:15:18 2014
@@ -1199,6 +1199,8 @@ public class NumberUtilsTest {
 
         compareIsNumberWithCreateNumber(null, false);
         compareIsNumberWithCreateNumber("", false);
+        compareIsNumberWithCreateNumber(" ", false);
+        compareIsNumberWithCreateNumber("\r\n\t", false);
         compareIsNumberWithCreateNumber("--2.3", false);
         compareIsNumberWithCreateNumber(".12.3", false);
         compareIsNumberWithCreateNumber("-123E", false);



Mime
View raw message