RFR: 8352184: Jtreg tests using CommandLineOptionTest.getVMTypeOption() and optionsvalidation.JVMOptionsUtils fail on static JDK [v3]
Jiangli Zhou
jiangli at openjdk.org
Wed Mar 26 19:28:24 UTC 2025
On Wed, 26 Mar 2025 17:46:55 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address @dholmes-ora's comment: Use `strlen` to get the length for ", static" and ", sharing".
>
> src/hotspot/share/runtime/abstract_vm_version.cpp line 167:
>
>> 165: const char* sharing_info = ", sharing";
>> 166: size_t len = strlen(mode) + (is_vm_statically_linked() ? strlen(static_info) : 0) +
>> 167: (CDSConfig::is_using_archive() ? strlen(sharing_info) : 0) + 1;
>
> Make it easier to add new cases:
>
> Suggestion:
>
> size_t len = strlen(mode) +
> (is_vm_statically_linked() ? strlen(static_info) : 0) +
> (CDSConfig::is_using_archive() ? strlen(sharing_info) : 0) +
> 1;
Done.
> test/hotspot/jtreg/runtime/CommandLine/OptionsValidation/common/optionsvalidation/JVMOptionsUtils.java line 71:
>
>> 69: } else if (Platform.isMinimal()) {
>> 70: VMType = "-minimal";
>> 71: }
>
> OK, so `isStatic` supercedes everything? Then just add a preceding block, like:
>
>
> if (Platform.isStatic()) {
> // In static JDK, no launcher options are accepted.
> VMType = null;
> } else if (Platform.isServer()) {
> VMType = "-server";
> } else if (Platform.isClient()) {
> VMType = "-client";
> } else if (Platform.isMinimal()) {
> VMType = "-minimal";
> } else {
> VMType = null;
> }
>
>
> ?
Suggestion applied.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24171#discussion_r2014863778
PR Review Comment: https://git.openjdk.org/jdk/pull/24171#discussion_r2014863579
More information about the hotspot-runtime-dev
mailing list