From f59a674a26d349b7069158023194ad0d7a38a9e4 Mon Sep 17 00:00:00 2001 From: Benedikt Ritter Date: Fri, 24 Jul 2015 13:07:12 +0200 Subject: [PATCH] Reuse functionality from StringUtils instead of duplicating code --- .../org/apache/commons/lang3/math/NumberUtils.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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 8f99c782d..d9a569f99 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 true 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); } /**