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