Remove DCmdFactory::_enabled

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: None
    • Component/s: hotspot
    • None
    • svc

      We have two fields in DCmdFactory, _enabled and _hidden:

      ============
      class DCmdFactory: public CHeapObj<mtInternal> {
        // When disabled, a diagnostic command cannot be executed. Any attempt to
        // execute it will result in the printing of the disabled message without
        // instantiating the command.
        const bool _enabled;
        // When hidden, a diagnostic command doesn't appear in the list of commands
        // provided by the 'help' command.
        const bool _hidden;
      ============

      All DCmdFactory are currently constructed with _enabled set to true. This seems to be a relic that no longer serves any purpose.

      _hidden is currently also always set to true, although it may be useful in the future. E.g., if we are deprecating a dcmd, we can hide it from the list but still leave it enabled for compatibility. Example:

      https://github.com/openjdk/jdk/blame/401d0d6b09ea422eacecda2900793a416097dc9b/src/hotspot/share/services/diagnosticCommand.cpp#L165C59-L165C59

      (The above line was eventually removed in JDK-8336401).

            Assignee:
            Ioi Lam
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: