Hello Eirik,

On 16/01/26 11:56 pm, Eirik Bjørsnøs wrote:
Hi,

java.lang.Shutdown uses a static nested Lock class for synchronization. This seems trivially replaceable with new Object() which would reduce class loading during shutdown.

Replacing the custom private class with Object instance looks OK to me. I had a look at the history of that code and it appears that it has been that way ever since Shutdown code was introduced, so doesn't look like that private class was introduced for any specific bug fix. While at it, you might also want to mark both the lock fields final.


java.lang.ref.ReferenceQueue uses a similar idiom and could potentially be cleaned up as well.

Looks OK to replace there too.

-Jaikiran

Reply via email to