This is an automated email from the ASF dual-hosted git repository.
garydgregory 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 99c22e51c Reject doubled leading sign in NumberUtils.createBigInteger
(#1702).
99c22e51c is described below
commit 99c22e51ca610a1c7c35c705a906e911b156451f
Author: Gary Gregory <[email protected]>
AuthorDate: Sat Jun 13 11:50:13 2026 +0000
Reject doubled leading sign in NumberUtils.createBigInteger (#1702).
---
src/changes/changes.xml | 1 +
src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 6a1791324..f76c6f675 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -186,6 +186,7 @@ java.lang.NullPointerException: Cannot invoke
<action type="fix" dev="ggregory" due-to="alhudz, Gary
Gregory">Fix case-insensitive Strings.replace() dropping length-changing
matches (#1697).</action>
<action type="fix" dev="ggregory" due-to="alhudz">Fix
int overflow in StringUtils.midString() and StrBuilder.midString() length
handling (#1699).</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory,
Javid Khan">Throw IllegalArgumentException for trailing whitespace in
ExtendedMessageFormat argument index (#1701).</action>
+ <action type="fix" dev="ggregory" due-to="alhudz, Gary
Gregory">Reject doubled leading sign in NumberUtils.createBigInteger
(#1702).</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary
Gregory">Add JavaVersion.JAVA_27.</action>
<action type="add" dev="ggregory" due-to="Gary
Gregory">Add SystemUtils.IS_JAVA_27.</action>
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 a3d270645..aa16c4b02 100644
--- a/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/math/NumberUtilsTest.java
@@ -494,6 +494,8 @@ void testCreateBigInteger() {
protected void testCreateBigIntegerFailure(final String str) {
assertThrows(NumberFormatException.class, () ->
NumberUtils.createBigInteger(str), "createBigInteger(\"" + str + "\") should
have failed.");
+ // Should match java.math.BigInteger.BigInteger(String)
+ assertThrows(NumberFormatException.class, () -> new BigInteger(str));
}
@Test