public class StackTraceFilter extends Object implements Serializable
| Constructor and Description |
|---|
StackTraceFilter() |
| Modifier and Type | Method and Description |
|---|---|
StackTraceElement[] |
filter(StackTraceElement[] target,
boolean keepTop)
Example how the filter works (+/- means good/bad):
[a+, b+, c-, d+, e+, f-, g+] -> [a+, b+, d+, e+, g+]
Basically removes all bad from the middle.
|
StackTraceElement |
filterFirst(Throwable target,
boolean isInline)
This filtering strategy makes use of a fast-path computation to retrieve stackTraceElements
from a Stacktrace of a Throwable.
|
String |
findSourceFile(StackTraceElement[] target,
String defaultValue)
Finds the source file of the target stack trace.
|
public StackTraceElement[] filter(StackTraceElement[] target, boolean keepTop)
public StackTraceElement filterFirst(Throwable target, boolean isInline)
SharedSecrets and JavaLangAccess.
The SharedSecrets provides a method to obtain an instance of an JavaLangAccess. The latter class has a method to fast-path into Throwable.getStackTrace() and retrieve a single StackTraceElement. This prevents the
JVM from having to generate a full stacktrace, which could potentially be expensive if
stacktraces become very large.
target - The throwable target to find the first StackTraceElement that should
not be filtered out per CLEANER.StackTraceElement outside of the CLEANERpublic String findSourceFile(StackTraceElement[] target, String defaultValue)
Copyright © 2025. All rights reserved.