jmx-dev RFR: 8338603: DiagnosticCommandMBean operations should standardize types for parameters

Chris Plummer cjplummer at openjdk.org
Wed Oct 9 20:39:12 UTC 2024


On Tue, 17 Sep 2024 14:10:07 GMT, Kevin Walls <kevinw at openjdk.org> 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21040#discussion_r1794193671


More information about the jmx-dev mailing list