Skip to content

Commit 1196f03

Browse files
committed
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
1 parent d8d3872 commit 1196f03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,16 +1031,17 @@ void testIsParsable() {
10311031
* Tests https://issues.apache.org/jira/browse/LANG-1729
10321032
*
10331033
* See https://bugs.openjdk.org/browse/JDK-8326627
1034-
*
1034+
*
10351035
* <blockquote>From https://docs.oracle.com/javase%2F9%2Fdocs%2Fapi%2F%2F/java/lang/Float.html#valueOf-java.lang.String-,
10361036
* 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,
10371037
* fullwidth Unicode digits are not applicable. Moved to JDK as an enhancement.</blockquote>
10381038
*/
10391039
@Test
10401040
void testIsParsableFullWidthUnicodeJDK8326627() {
10411041
// 123 in fullwidth Unicode digits
1042-
assertThrows(NumberFormatException.class, () -> Double.parseDouble("\uFF10\uFF11\uFF12"));
1043-
assertThrows(NumberFormatException.class, () -> Float.parseFloat("123"));
1042+
final String fullWidth123 = "\uFF10\uFF11\uFF12";
1043+
assertThrows(NumberFormatException.class, () -> Double.parseDouble(fullWidth123));
1044+
assertThrows(NumberFormatException.class, () -> Float.parseFloat(fullWidth123));
10441045
}
10451046

10461047
@Test

0 commit comments

Comments
 (0)