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 19a58f507 Simplify ExceptionUtils.getRootCauseStackTraceList(Throwable)
19a58f507 is described below
commit 19a58f50758239a613afbceca8a308648ecf2d55
Author: Gary Gregory <[email protected]>
AuthorDate: Sun Oct 25 09:10:45 2026 -0400
Simplify ExceptionUtils.getRootCauseStackTraceList(Throwable)
Simplify root cause stack trace formatting.
Extract the throwable string and use a conditional expression to add the
wrapped marker, preserving existing behavior.
---
.../java/org/apache/commons/lang3/exception/ExceptionUtils.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
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 fcdfdffaa..5eedb916a 100644
--- a/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
+++ b/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java
@@ -406,11 +406,8 @@ public static List<String>
getRootCauseStackTraceList(final Throwable throwable)
nextTrace = getStackFrameList(throwables[i - 1]);
removeCommonFrames(trace, nextTrace);
}
- if (i == count - 1) {
- frames.add(throwables[i].toString());
- } else {
- frames.add(WRAPPED_MARKER + throwables[i].toString());
- }
+ final String string = throwables[i].toString();
+ frames.add(i == count - 1 ? string : WRAPPED_MARKER + string);
frames.addAll(trace);
}
return frames;