ppkarwasz commented on code in PR #1214:
URL: https://github.com/apache/logging-log4j2/pull/1214#discussion_r1072880845
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyHelper.java:
##########
@@ -85,7 +85,7 @@ static ExtendedStackTraceElement[] toExtendedStackTrace(
stackLength = stackTrace.length;
}
final ExtendedStackTraceElement[] extStackTrace = new
ExtendedStackTraceElement[stackLength];
- Class<?> clazz = stack.isEmpty() ? null : stack.peek();
+ Class<?> clazz = stack.isEmpty() ? null : stack.peekLast();
Review Comment:
[`Deque#peekLast()`](https://docs.oracle.com/javase/8/docs/api/java/util/Deque.html#peekLast--)
already returns `null` if the deque is empty, so the check is not necessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]