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 <[email protected]> on behalf of Eirik 
Bjørsnøs <[email protected]>
Sent: Wednesday, January 21, 2026 12:28 AM
To: David Holmes <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: RFD: Replace class java.lang.Shutdown.Lock with Object?

On Wed, Jan 21, 2026 at 6:38 AM David Holmes 
<[email protected]<mailto:[email protected]>> 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.

Reply via email to