RFD: Replace class java.lang.Shutdown.Lock with Object?

Chen Liang chen.l.liang at oracle.com
Sun Jan 25 16:17:53 UTC 2026


Checked this and noted this Lock is used by both lock and shutdownLock - this makes the Lock class less informative to me.
Maybe we should replace one of the locks with Object, or add a new class to distinguish these two locks?


Confidential- Oracle Internal

________________________________
From: core-libs-dev <core-libs-dev-retn at openjdk.org> on behalf of Eirik Bjørsnøs <eirbjo at gmail.com>
Sent: Wednesday, January 21, 2026 12:28 AM
To: David Holmes <david.holmes at oracle.com>
Cc: core-libs-dev at openjdk.org <core-libs-dev at openjdk.org>
Subject: Re: RFD: Replace class java.lang.Shutdown.Lock with Object?

On Wed, Jan 21, 2026 at 6:38 AM David Holmes <david.holmes at oracle.com<mailto:david.holmes at oracle.com>> wrote:

No I suppose not. Though I'm not sure trimming the class will make any
observable/practical difference in the normal case.

Thanks! I agree trimming these two classes (of ~428 loaded at startup) alone has limited value. But there are other berries to pick and the cumulative impact may have an observable effect on startup. Two berries feed no one, with a handful we can make a delicious jam :)

So effectively this is like declaring a single global class that all
"new Object()'s" would be instances of.

So using new Object() will not be a problem.

Thanks for the Valhalla reference, interesting to see how "new Object()" can be redefined like this.

Eirik.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20260125/fdcdcc01/attachment.htm>


More information about the core-libs-dev mailing list