On Fri, 3 Jul 2026 13:06:08 GMT, Kieran Farrell <[email protected]> wrote:

>> This patch adds a new jcmd diagnostic command, `VM.show_settings`, to make 
>> the existing -`XshowSettings` output available from a running VM. The 
>> command accepts the same sections as`XshowSettings` (all, vm, properties, 
>> locale, security, system, security:all, security:properties, 
>> security:providers, security:tls). 
>> 
>> HotSpot registers the new diagnostic command, validates the requested 
>> section, then calls into `sun.launcher.LauncherHelper` to reuse the existing 
>> show settings formatting and return the result as bytes for the jcmd stream. 
>> The VM settings path also passes hotspots `InitialHeapSize`, `MaxHeapSize`, 
>> and Java thread stack size into the Java helper. A new jcmd test covers VM, 
>> properties, security TLS, and invalid-input output.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Kieran Farrell has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   remove validation

src/hotspot/share/services/diagnosticCommand.cpp line 483:

> 481:   // resolve sun.launcher.LauncherHelper
> 482:   Symbol* klass_sym = vmSymbols::sun_launcher_LauncherHelper();
> 483:   Klass* k = SystemDictionary::resolve_or_fail(klass_sym, true, CHECK);

Why is exception handling here completely different to that from 
`java_lang_String::create_from_str` below?

src/java.base/share/classes/sun/launcher/LauncherHelper.java line 189:

> 187:         } catch (IllegalArgumentException e) {
> 188:             System.exit(1);
> 189:         }

Suggestion:

        } catch (IllegalArgumentException e) {
            // the invalid option message has already been written to ostream.
            System.exit(1);
        }

src/java.base/share/classes/sun/launcher/LauncherHelper.java line 219:

> 217:         }
> 218: 
> 219:         if (optionFlag.equals("-XshowSetings:")) {

This line has a pre-existing typo `Setings`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31742#discussion_r3526153538
PR Review Comment: https://git.openjdk.org/jdk/pull/31742#discussion_r3526189920
PR Review Comment: https://git.openjdk.org/jdk/pull/31742#discussion_r3526185098

Reply via email to