[jdk17] RFR: 8269543: The warning for System::setSecurityManager should only appear once for each caller
Weijun Wang
weijun at openjdk.java.net
Tue Jun 29 21:22:05 UTC 2021
On Tue, 29 Jun 2021 19:57:24 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> If I switch to a "non-weak" set or map, then it seems I can safely use the source string as the key. Will using the Class object as a key prevent them from unloading?
>
> Using a synchronized WeakHashMap with the class as the key would not prevent class unloading.
> Using a non-weak set or map to strings would keep the strings around for the life of the runtime.
I hope this is uncommon but if that class is created by a `ClassLoader` again and again then it will be different each time. I'll investigate more.
-------------
PR: https://git.openjdk.java.net/jdk17/pull/166
More information about the security-dev
mailing list