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

commit 1196f03e4f0b5de78416771259cb8ab60fb20e0f
Author: Gary Gregory <[email protected]>
AuthorDate: Tue Dec 16 07:56:57 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
---
 src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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 69db094b5..2b39007b6 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -1031,7 +1031,7 @@ void testIsParsable() {
      * 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>
@@ -1039,8 +1039,9 @@ void testIsParsable() {
     @Test
     void testIsParsableFullWidthUnicodeJDK8326627() {
         // 123 in fullwidth Unicode digits
-        assertThrows(NumberFormatException.class, () -> 
Double.parseDouble("\uFF10\uFF11\uFF12"));
-        assertThrows(NumberFormatException.class, () -> 
Float.parseFloat("123"));
+        final String fullWidth123 = "\uFF10\uFF11\uFF12";
+        assertThrows(NumberFormatException.class, () -> 
Double.parseDouble(fullWidth123));
+        assertThrows(NumberFormatException.class, () -> 
Float.parseFloat(fullWidth123));
     }
 
     @Test

Reply via email to