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 d8d387287 Add 
NumberUtilsTest.testIsParsableFullWidthUnicodeJDK8326627()
d8d387287 is described below

commit d8d3872872088db6e748e91ea7e353b5aa5cca06
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Dec 16 07:30:26 2025 -0500

    Add NumberUtilsTest.testIsParsableFullWidthUnicodeJDK8326627()
    
    The JDK ticket https://bugs.openjdk.org/browse/JDK-8326627
    
    says:
    
    From 
https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/lang/Float.html#valueOf-java.lang.String-,
    https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2,
    and https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-Digits,
    fullwidth Unicode digits are not applicable. Moved to JDK as an
    enhancement.
    
    Tested on Java 8, 11, 17, 21, and 25
---
 .../org/apache/commons/lang3/math/NumberUtilsTest.java   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java 
b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
index a49fdd39b..69db094b5 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -1027,6 +1027,22 @@ void testIsParsable() {
         assertTrue(NumberUtils.isParsable("-.236"));
     }
 
+    /**
+     * Tests https://issues.apache.org/jira/browse/LANG-1729
+     *
+     * See https://bugs.openjdk.org/browse/JDK-8326627
+     * 
+     * <blockquote>From 
https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/lang/Float.html#valueOf-java.lang.String-,
+     * 
https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.10.2, and 
https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-Digits,
+     * fullwidth Unicode digits are not applicable. Moved to JDK as an 
enhancement.</blockquote>
+     */
+    @Test
+    void testIsParsableFullWidthUnicodeJDK8326627() {
+        // 123 in fullwidth Unicode digits
+        assertThrows(NumberFormatException.class, () -> 
Double.parseDouble("\uFF10\uFF11\uFF12"));
+        assertThrows(NumberFormatException.class, () -> 
Float.parseFloat("123"));
+    }
+
     @Test
     void testLang1087() {
         // no sign cases

Reply via email to