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-bcel.git
commit 1e4023d82dbe6e223ea12dc0063bf58d1cd91af7 Author: Gary Gregory <[email protected]> AuthorDate: Sat Feb 14 09:07:18 2026 -0500 Deprecate org.apache.bcel.verifier.exc.Utility.getStackTrace(Throwable) --- src/changes/changes.xml | 1 + src/main/java/org/apache/bcel/verifier/exc/Utility.java | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index bc6820af..f979dd52 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -63,6 +63,7 @@ The <action> type attribute can be add,update,fix,remove. <!-- FIX --> <action type="fix" dev="ggregory" due-to="nbauma109">Fix constant pool module access test on Java 26 and above #492.</action> <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate org.apache.bcel.classfile.Utility.Utility().</action> + <action type="fix" dev="ggregory" due-to="Gary Gregory">Deprecate org.apache.bcel.verifier.exc.Utility.getStackTrace(Throwable).</action> <!-- ADD --> <action type="add" dev="ggregory" due-to="nbauma109, Gary Gregory">Add support for permitted subclasses #493.</action> <action type="add" dev="ggregory" due-to="nbauma109, Gary Gregory">Add RecordComponentInfo.getAttribute(byte tag)#494.</action> diff --git a/src/main/java/org/apache/bcel/verifier/exc/Utility.java b/src/main/java/org/apache/bcel/verifier/exc/Utility.java index b0d06c8c..fae5dfef 100644 --- a/src/main/java/org/apache/bcel/verifier/exc/Utility.java +++ b/src/main/java/org/apache/bcel/verifier/exc/Utility.java @@ -18,8 +18,7 @@ */ package org.apache.bcel.verifier.exc; -import java.io.PrintWriter; -import java.io.StringWriter; +import org.apache.commons.lang3.exception.ExceptionUtils; /** * A utility class providing convenience methods concerning Throwable instances. @@ -33,12 +32,10 @@ public final class Utility { * * @param t the Throwable instance. * @return the stack trace as a String. + * @deprecated Use {@link ExceptionUtils#getStackTrace(Throwable)}. */ public static String getStackTrace(final Throwable t) { - final StringWriter sw = new StringWriter(); - final PrintWriter pw = new PrintWriter(sw); - t.printStackTrace(pw); - return sw.toString(); + return ExceptionUtils.getStackTrace(t); } /** This class is not instantiable. */
