You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/08/20 22:24:19 UTC
(commons-lang) 03/07: Add org.apache.commons.lang3.concurrent.ConcurrentException.ConcurrentException(String)
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
commit 5019152951ad0d9fe65961b5f6e0d1527f876bd5
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Wed Aug 20 18:14:14 2025 -0400
Add org.apache.commons.lang3.concurrent.ConcurrentException.ConcurrentException(String)
---
src/changes/changes.xml | 1 +
.../apache/commons/lang3/concurrent/ConcurrentException.java | 11 +++++++++++
.../apache/commons/lang3/concurrent/ConcurrentUtilsTest.java | 8 +++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 305fcc4e2..7eb7038ba 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="add" dev="ggregory" due-to="Gary Gregory">Add org.apache.commons.lang3.reflect.MethodUtils.getAccessibleMethod(Class, Method).</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add documentation to site for CVE-2025-48924 ClassUtils.getClass(...) can throw a StackOverflowError on very long inputs.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add org.apache.commons.lang3.StringUtils.indexOfAny(CharSequence, int, char...).</action>
+ <action type="add" dev="ggregory" due-to="Gary Gregory">Add org.apache.commons.lang3.concurrent.ConcurrentException.ConcurrentException(String).</action>
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">[test] Bump org.apache.commons:commons-text from 1.13.1 to 1.14.0.</action>
</release>
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentException.java b/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentException.java
index 28514d548..8b25a92fd 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentException.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/ConcurrentException.java
@@ -41,6 +41,17 @@ public class ConcurrentException extends Exception {
protected ConcurrentException() {
}
+ /**
+ * Constructs a new exception with the specified detail message. The cause is not initialized, and may subsequently be initialized by a call to
+ * {@link #initCause}.
+ *
+ * @param message the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
+ * @since 3.19.0
+ */
+ public ConcurrentException(final String message) {
+ super(message);
+ }
+
/**
* Creates a new instance of {@link ConcurrentException} and initializes it
* with the given message and cause.
diff --git a/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java b/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
index 6b074d53a..8e12f3061 100644
--- a/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/concurrent/ConcurrentUtilsTest.java
@@ -52,7 +52,13 @@ void testConcurrentExceptionCauseError() {
*/
@Test
void testConcurrentExceptionCauseNull() {
- assertIllegalArgumentException(() -> new ConcurrentException(null));
+ assertIllegalArgumentException(() -> new ConcurrentException((Throwable) null));
+ }
+
+ @Test
+ void testConcurrentExceptionCauseString() {
+ assertEquals("test", new ConcurrentException("test").getMessage());
+ assertNull(new ConcurrentException((String) null).getMessage());
}
/**