This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git


The following commit(s) were added to refs/heads/master by this push:
     new 02732d6  LANG-1527: Remove an redundant argument check in NumberUtils. 
(#504)
02732d6 is described below

commit 02732d6132da6e720502f357e91e3937df76d8fa
Author: Prodigysov <prodigy....@gmail.com>
AuthorDate: Sun Mar 15 15:34:25 2020 -0500

    LANG-1527: Remove an redundant argument check in NumberUtils. (#504)
---
 src/main/java/org/apache/commons/lang3/math/NumberUtils.java | 7 -------
 1 file changed, 7 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 ab7badc..38240c2 100644
--- a/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
+++ b/src/main/java/org/apache/commons/lang3/math/NumberUtils.java
@@ -987,13 +987,6 @@ public class NumberUtils {
         if (StringUtils.isBlank(str)) {
             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);
     }
 

Reply via email to