commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [2/2] [lang] Reuse functionality from StringUtils instead of duplicating code
Date Fri, 24 Jul 2015 11:08:04 GMT
Reuse functionality from StringUtils instead of duplicating code


Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/f59a674a
Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/f59a674a
Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/f59a674a

Branch: refs/heads/master
Commit: f59a674a26d349b7069158023194ad0d7a38a9e4
Parents: 5fb158c
Author: Benedikt Ritter <britter@apache.org>
Authored: Fri Jul 24 13:07:12 2015 +0200
Committer: Benedikt Ritter <britter@apache.org>
Committed: Fri Jul 24 13:07:12 2015 +0200

----------------------------------------------------------------------
 .../java/org/apache/commons/lang3/math/NumberUtils.java   | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-lang/blob/f59a674a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
index 8f99c78..d9a569f 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -1348,15 +1348,7 @@ public class NumberUtils {
      * @return <code>true</code> if str contains only Unicode numeric
      */
     public static boolean isDigits(final String str) {
-        if (StringUtils.isEmpty(str)) {
-            return false;
-        }
-        for (int i = 0; i < str.length(); i++) {
-            if (!Character.isDigit(str.charAt(i))) {
-                return false;
-            }
-        }
-        return true;
+        return StringUtils.isNumeric(str);
     }
 
     /**


Mime
View raw message