clarify behavior of #isNumber() with blanks

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1645076 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Matthew Jason Benson 2014-12-12 21:15:18 +00:00
parent d4cf0864ff
commit 05763470e5
2 changed files with 3 additions and 1 deletions

View File

@ -1344,7 +1344,7 @@ public static boolean isDigits(final String str) {
* <code>false</code>, since <code>9</code> is not a valid octal value. * <code>false</code>, since <code>9</code> is not a valid octal value.
* However, numbers beginning with {@code 0.} are treated as decimal.</p> * 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> * <code>false</code>.</p>
* *
* @param str the <code>String</code> to check * @param str the <code>String</code> to check

View File

@ -1199,6 +1199,8 @@ public void testIsNumber() {
compareIsNumberWithCreateNumber(null, false); compareIsNumberWithCreateNumber(null, false);
compareIsNumberWithCreateNumber("", false); compareIsNumberWithCreateNumber("", false);
compareIsNumberWithCreateNumber(" ", false);
compareIsNumberWithCreateNumber("\r\n\t", false);
compareIsNumberWithCreateNumber("--2.3", false); compareIsNumberWithCreateNumber("--2.3", false);
compareIsNumberWithCreateNumber(".12.3", false); compareIsNumberWithCreateNumber(".12.3", false);
compareIsNumberWithCreateNumber("-123E", false); compareIsNumberWithCreateNumber("-123E", false);