On Fri, 4 Jun 2021 10:14:21 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:
>> src/java.base/share/classes/javax/crypto/JceSecurityManager.java line 109: >> >>> 107: @SuppressWarnings("removal") >>> 108: List<StackFrame> stack = >>> 109: AccessController.doPrivileged(pa).walk(Stream::toList); >> >> You can replace line 108-125 with something like this: >> >> StackWalker walker = AccessController.doPrivileged(pa); >> Optional<URL> callerCodeBase = walker.walk(s -> { >> s.map(f -> JceSecurity.getCodeBase(f.getDeclaringClass())) >> .findFirst(); >> }); > > @mlchung Maybe there should be a `.filter(cb -> cb != null)` inserted before > `.findFirst()`? Daniel is right and it needs the filter to find the first non-null code base. ------------- PR: https://git.openjdk.java.net/jdk/pull/4150