JDK-8276982 : VM.class_hierarchy jcmd help output and man page text needs clarifications/improvements
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-11
  • Updated: 2022-01-03
  • Resolved: 2021-12-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 19
19 b03Fixed
Related Reports
Relates :  
Description
The man page output for the VM.class_hierarchy jcmd is incorrect w.r.t. the -s option. It says:

-s: (Optional) If a class name is specified, it prints the subclasses.  If the  class  name
is not specified, only the superclasses are printed.  (BOOLEAN, false)

This is incorrect. The second sentence should say something along the lines of "If the -s option is not specified..."

The jcmd help output is a bit better, but also a bit ambiguous:

-s : [optional] If a classname is specified, print its subclasses. Otherwise only its 
superclasses are printed.   (BOOLEAN, false)

"Otherwise" could interpreted as "if a classname is NOT specified", but the intended meaning is "If the -s option is not specified". I think the wording for each should be changed to:

-s: [optional] If a classname is specified print its subclasses in addition to its superclasses. Without this option only the superclasses will be printed.  (BOOLEAN, false)
Comments
Changeset: 7ce4aa89 Author: Chris Plummer <cjplummer@openjdk.org> Date: 2021-12-16 23:25:07 +0000 URL: https://git.openjdk.java.net/jdk/commit/7ce4aa894279b76b6033bb4a1d0caa00d4213406
16-12-2021