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 78c581d85 Deprecate ExceptionUtils.removeCommonFrames(), which is now
used only. Root-cause stack trace generation compares StackTraceElement objects
directly.
78c581d85 is described below
commit 78c581d856e99c44a28fd60b054b2a3422de9a94
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Oct 25 09:55:18 2026 -0400
Deprecate ExceptionUtils.removeCommonFrames(), which is now used only.
Root-cause stack trace generation compares StackTraceElement objects
directly.
---
src/changes/changes.xml | 1 +
.../apache/commons/lang3/exception/ExceptionUtils.java | 15 ++++++++-------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 82d056f1c..c2079f682 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -76,6 +76,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="alhuda, Gary
Gregory">Stop ExceptionUtils.removeCommonFrames at the first differing frame
(#1831).</action>
<action type="fix" dev="ggregory" due-to="Gary
Gregory">Use StackTraceElement objects to build compact root cause stack
traces, avoiding text parsing and preventing exception message text from being
mistaken for stack frames.</action>
<action type="fix" dev="ggregory" due-to="alhuda, Gary
Gregory">Restrict LocaleUtils.toLocale to ASCII language, country, and numeric
area codes; previously accepted non-ASCII codes now cause
IllegalArgumentException (#1838).</action>
+ <action type="fix" dev="ggregory" due-to="Gary
Gregory">Deprecate ExceptionUtils.removeCommonFrames(), which is now used only
by tests. Root-cause stack trace generation compares StackTraceElement objects
directly.</action>
<!-- ADD -->
<!-- UPDATE -->
<action type="update" dev="ggregory" due-to="Gary Gregory">Bump
org.apache.commons:commons-parent from 105 to 106.</action>
diff --git
a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
index 76554439e..566a44f50 100644
--- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
+++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
@@ -822,23 +822,24 @@ public static void printRootCauseStackTrace(final
Throwable throwable, final Pri
/**
* Removes the longest shared suffix from the cause stack trace.
- *
* <p>
- * Compares frame strings from the ends of the two lists, stopping at the
first difference or when either list is exhausted. Frames at lower indexes
- * than the first differing frame are retained, even if they match. The
cause list is modified in place. The wrapper list is only read; changes to the
- * cause list may also be visible through the wrapper list if the lists
share backing storage.
+ * Compares frame strings from the ends of the two lists, stopping at the
first difference or when either list is exhausted. Frames at lower indexes than
+ * the first differing frame are retained, even if they match. The cause
list is modified in place. The wrapper list is only read; changes to the cause
list
+ * may also be visible through the wrapper list if the lists share backing
storage.
* </p>
- *
* <p>
* This follows the shared-suffix rule used by {@link
Throwable#printStackTrace()}, but compares formatted frame strings rather than
* {@link StackTraceElement} objects.
* </p>
*
- * @param causeFrames stack trace of a cause throwable, from which the
shared suffix is removed.
- * @param wrapperFrames stack trace of a wrapper throwable, used for
comparison.
+ * @param causeFrames stack trace of a cause throwable, from which the
shared suffix is removed.
+ * @param wrapperFrames stack trace of a wrapper throwable, used for
comparison.
* @throws NullPointerException Thrown if either argument is null.
* @since 2.0
+ * @deprecated No longer used internally. Prefer comparing {@link
StackTraceElement} objects obtained from {@link Throwable#getStackTrace()}
instead of
+ * formatted frame strings. There is no direct replacement.
*/
+ @Deprecated
public static void removeCommonFrames(final List<String> causeFrames,
final List<String> wrapperFrames) {
Objects.requireNonNull(causeFrames, "causeFrames");
Objects.requireNonNull(wrapperFrames, "wrapperFrames");