jmx-dev RFR: 8373441: Remove DCmdFactory::_enabled [v2]

David Holmes dholmes at openjdk.org
Tue Dec 16 05:45:53 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

For the history see 

https://bugs.openjdk.org/browse/JDK-7104647?focusedId=12336354&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12336354

The "enabled" capability came from the JRockit jrcmd tool:

https://docs.oracle.com/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/ctrlbreakhndlr.html

> "You can enable or disable any diagnostic command using the system property -Djrockit.ctrlbreak.enable<name>=<true|false>, where name is the name of the diagnostic command."

But as far as I can see the DCmd framework never specified a mechanism for disabling a DCmd. @fparain may recall more details.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28794#issuecomment-3658938216


More information about the jmx-dev mailing list