On Wed, 9 Oct 2024 20:36:07 GMT, Chris Plummer <[email protected]> wrote:
>> DiagnosticCommandImpl should only publish parameter types in a known
>> standard set, and use "STRING" on anything else.
>> e.g. We can say "FILE" in the help output for jcmd, as that's for humans,
>> but the MBean parameter info should contain "STRING".
>
> test/jdk/com/sun/management/DiagnosticCommandMBean/DcmdMBeanTest.java line
> 133:
>
>> 131:
>> 132: // Knowledge of the types made public by
>> com.sun.management.internal.DiagnosticCommandImpl
>> 133: private static final String [] publicTypes = new String [] { "INT",
>> "STRING", "BOOLEAN", "STRING SET", "MEMORY SIZE", "NANOTIME" };
>
> These type are "implementation dependent", yet we are referring to them as
> public types. Also, these "public types" are now in two different places. If
> they were public, only one copy should be needed. Maybe we just need better
> terminology since they are not actually public, but just happen to be the
> types the implementation is know to return...err, I guess you could say the
> leak out to the "public". Sigh. IDK. I guess I just feel we could do a better
> job in how we refer to these types in the code.
Right, public as in the type names which are observable by applications/users,
not as in Java type terminology.
Comment could be:
// Knowledge of the implementation-dependent types in DiagnosticCommandImpl,
seen by applications/users
// (see the DiagnosticCommandMBean Descriptor, field "dcmd.arg.type").
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21040#discussion_r1794931004