jmx-dev RFR: 8373441: Remove DCmdFactory::_enabled [v2]
David Holmes
dholmes at openjdk.org
Mon Dec 15 06:13:55 UTC 2025
On Fri, 12 Dec 2025 23:37:20 GMT, Ioi Lam <iklam at openjdk.org> wrote:
>> The `DCmdFactory::_enabled` is always set to `true` and there doesn't seem to be a reason to set it to `false`.
>>
>> This PR removes this field and simplified the creation of `DCmdFactory` objects.
>>
>> The related `_hidden` field is also currently not used, but may be used in the future when deprecating DCmds, so we leave it unchanged.
>>
>> Note that now `jmm_GetDiagnosticCommandInfo()` always set `dcmdInfo::enabled` to `true` to be compatible with Java code.
>
> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>
> @kevinjwalls comments
If we are just changing the implementation then I guess this would be okay. But it seems the API for this allows for specific DCmds to be disabled (how?) - or at least intended for it to be possible. As per the doc:
> When the set of diagnostic commands currently supported by the Java Virtual Machine is modified, the DiagnosticCommandMBean emits a [Notification](https://docs.oracle.com/javase/8/docs/api/javax/management/Notification.html?is-external=true) with a [type](https://docs.oracle.com/javase/8/docs/api/javax/management/Notification.html?is-external=true#getType--) of[ "jmx.mbean.info.changed"](https://docs.oracle.com/javase/8/docs/api/javax/management/MBeanInfo.html#info-changed) and a [userData](https://docs.oracle.com/javase/8/docs/api/javax/management/Notification.html?is-external=true#getUserData--) that is the new MBeanInfo.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28794#issuecomment-3653521831
More information about the jmx-dev
mailing list