On Wed, 30 Jun 2021 06:32:04 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> I hope this is uncommon but if that class is loaded by a `ClassLoader` again >> and again then it will be different each time. I'll investigate more. > > WeakHashMap<Class<?>, Boolean>, where the key is the caller, should be okay > (assume synchronization of course). Even with applications that do call > setSecurityManager then the map is probably going to be one entry. I wouldn't > expect it is common to create custom class loaders that load code that sets a > security manager, meaning it is more likely that the container sets the SM > rather have each plugin/application/whatever try to set the system-wide SM. Thanks. Switched to Class<?> as cache key. New commit pushed. ------------- PR: https://git.openjdk.java.net/jdk17/pull/166