From fa2cb07d066dce51917381583ccf21d438b721f8 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:26:44 +0100 Subject: [PATCH] fixed files form Lang #44 --- projects/Lang/44/org/apache/commons/lang/NumberUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/Lang/44/org/apache/commons/lang/NumberUtils.java b/projects/Lang/44/org/apache/commons/lang/NumberUtils.java index 18a05ef..c5ca8cd 100644 --- a/projects/Lang/44/org/apache/commons/lang/NumberUtils.java +++ b/projects/Lang/44/org/apache/commons/lang/NumberUtils.java @@ -142,6 +142,9 @@ public static Number createNumber(String val) throws NumberFormatException { if (val.length() == 0) { throw new NumberFormatException("\"\" is not a valid number."); } + if (val.length() == 1 && !Character.isDigit(val.charAt(0))) { + throw new NumberFormatException(val + " is not a valid number."); + } if (val.startsWith("--")) { // this is protection for poorness in java.lang.BigDecimal. // it accepts this as a legal value, but it does not appear