On Thu, 21 Nov 2024 10:24:28 GMT, Daniel Fuchs <[email protected]> wrote:
>> This PR remove usage of SecurityManager, doPrivileges, etc... from
>> `java.logging` and `java.base/jdk.internal.logger`
>>
>> Only notable hack - Logger.checkPermission() no longer checks permissions,
>> but has been renamed into `ensureLogManagerInitialized()` in order to avoid
>> disturbing the initialization sequence of Logger/LogManager.
>>
>> I am not 100% sure this is still needed - but I remember we had some
>> entanglement issues in the past that had been hard to solve, so it seemed
>> prudent to keep the call:
>>
>>
>> if (manager == null) {
>> manager = LogManager.getLogManager();
>> }
>>
>>
>> where `manager` is a private volatile field in Logger.
>>
>> I also took the opportunity to remove the locking workaround that had been
>> introduced to support Virtual Threads and revert to using synchronized in
>> the Handler classes now that JEP 491 has been integrated.
>
> Daniel Fuchs has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Review feedback
src/java.logging/share/classes/java/util/logging/LogManager.java line 467:
> 465: @SuppressWarnings("removal")
> 466: SecurityManager sm = System.getSecurityManager();
> 467: JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess();
`JavaAWTAccess` is now unused and can be removed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22281#discussion_r1870061823