On Tue, 25 Nov 2025 12:10:02 GMT, Kevin Walls <[email protected]> wrote:
>> Mat Carter has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Remove single whitespace
>
> src/jdk.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java
> line 192:
>
>> 190: HotSpotAOTCacheMXBean impl = this.impl;
>> 191: if (impl == null) {
>> 192: this.impl = impl = new
>> HotSpotAOTCacheImpl(ManagementFactoryHelper.getVMManagement());
>
> This assignment is unusual. Are we trying to avoid a synchronized block?
> Other nameToMBeanMap() methods are like:
> return Collections.singletonMap(ManagementFactory.MEMORY_MXBEAN_NAME,
> ManagementFactoryHelper.getMemoryMXBean());
>
> ..where the ManagementFactoryHelper.getMemoryMXBean() method is synchronized
> and creates the impl if needed.
I don't see a correctly issue with this. Maybe in the future we will be able to
use LazyConstant here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28010#discussion_r2559800006