On Tue, 15 Oct 2024 22:15:45 GMT, Sean Mullan <[email protected]> wrote:
>> src/java.base/share/classes/java/lang/SecurityManager.java line 72:
>>
>>> 70: private static class StackWalkerHolder {
>>> 71: static final StackWalker STACK_WALKER =
>>> 72:
>>> StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE);
>>
>> Suggestion:
>>
>> StackWalker.getInstance(Set.of(Option.DROP_METHOD_INFO,
>> Option.RETAIN_CLASS_REFERENCE));
>>
>>
>> Method info is not needed.
>
> Thanks, will fix.
SecurityManager::getClassContext hasn't been needed since JDK 9 but we decided
to keep the implementation in case there are older versions of logging
libraries that extend SecurityManager so they can call this method. What we
have not in the jep486 is okay, it would be a bit more efficient if method info
is dropped, but I think mostly we want to have any remaining usages of this
method to move to StackWalker.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1802437558