This is an automated email from the ASF dual-hosted git repository. ckozak pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 25c7001f4609438aaca803b2b577aab565e1ccdf Author: Carter Kozak <[email protected]> AuthorDate: Tue Aug 3 16:32:32 2021 -0400 Remove unreleased+replaced StackLocator API from LOG4J2-2940 --- .../java/org/apache/logging/log4j/util/StackLocator.java | 6 ------ .../org/apache/logging/log4j/util/StackLocatorUtil.java | 13 ++----------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java index 3fb936a..2a92d8f 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocator.java @@ -63,16 +63,10 @@ public final class StackLocator { @PerformanceSensitive public Class<?> getCallerClass(final String fqcn, final String pkg) { - return getCallerClass(fqcn, pkg, 0); - } - - @PerformanceSensitive - public Class<?> getCallerClass(final String fqcn, final String pkg, final int skipDepth) { return walker.walk(s -> s .dropWhile(f -> !f.getClassName().equals(fqcn)) .dropWhile(f -> f.getClassName().equals(fqcn)) .dropWhile(f -> !f.getClassName().startsWith(pkg)) - .skip(skipDepth) .findFirst()) .map(StackWalker.StackFrame::getDeclaringClass) .orElse(null); diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocatorUtil.java b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocatorUtil.java index 482ee33..d27fb9c 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocatorUtil.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/util/StackLocatorUtil.java @@ -59,24 +59,15 @@ public final class StackLocatorUtil { } /** - * Equivalent to {@link #getCallerClass(String, String, int)} with {@code skipDepth = 0}. - */ - @PerformanceSensitive - public static Class<?> getCallerClass(final String fqcn, final String pkg) { - return stackLocator.getCallerClass(fqcn, pkg); - } - - /** * Search for a calling class. * * @param fqcn Root class name whose caller to search for. * @param pkg Package name prefix that must be matched after the {@code fqcn} has been found. - * @param skipDepth Number of stack frames to skip after the {@code fqcn} and {@code pkg} have been matched. * @return The caller class that was matched, or null if one could not be located. */ @PerformanceSensitive - public static Class<?> getCallerClass(final String fqcn, final String pkg, final int skipDepth) { - return stackLocator.getCallerClass(fqcn, pkg, skipDepth); + public static Class<?> getCallerClass(final String fqcn, final String pkg) { + return stackLocator.getCallerClass(fqcn, pkg); } /**
