LANG-1527: Remove an redundant argument check in NumberUtils. (#504)

This commit is contained in:
Prodigysov 2020-03-15 15:34:25 -05:00 committed by GitHub
parent 893cc1512b
commit 02732d6132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 7 deletions

View File

@ -987,13 +987,6 @@ public static BigDecimal createBigDecimal(final String str) {
if (StringUtils.isBlank(str)) { if (StringUtils.isBlank(str)) {
throw new NumberFormatException("A blank string is not a valid number"); throw new NumberFormatException("A blank string is not a valid number");
} }
if (str.trim().startsWith("--")) {
// this is protection for poorness in java.lang.BigDecimal.
// it accepts this as a legal value, but it does not appear
// to be in specification of class. OS X Java parses it to
// a wrong value.
throw new NumberFormatException(str + " is not a valid number.");
}
return new BigDecimal(str); return new BigDecimal(str);
} }