On Mon, 27 Jul 2026 12:10:25 GMT, Guanqiang Han <[email protected]> wrote:

>> Please review this change, thanks!
>> 
>> **Description:**
>> 
>> Some VM long options only accept arguments in the `--option=value` form, 
>> even though the launcher help states that long-option arguments may also be 
>> separated by whitespace. As a result, options such as 
>> `--illegal-final-field-mutation debug`, `--illegal-native-access warn`  are 
>> not parsed correctly.
>> 
>> **Solution:**
>> 
>> Add `IsNonModuleVMWhiteSpaceOption()` to identify VM long options that 
>> accept whitespace-separated arguments and convert them to the 
>> `--option=value` form before passing them to the VM. Add 
>> `--enable-final-field-mutation` to the existing module-option handling. 
>> Normalize missing arguments for other VM long options to `--option=` so that 
>> they can be handled by the existing option validation logic.
>> 
>> **Test:**
>> 
>> GHA
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Guanqiang Han has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add missing comma

Changes requested by bchristi (Reviewer).

test/jdk/java/lang/Object/FinalizationOption.java line 123:

> 121:             return;
> 122:         }
> 123: 

Updating `main()` like this seems unnecessary.
Can't this be done just by adding a couple `@run` options?
E.g.:

 * @run main/othervm --finalization enabled  FinalizationOption yes
 * @run main/othervm --finalization disabled FinalizationOption no

test/jdk/java/lang/Object/InvalidFinalizationOption.java line 43:

> 41:                         "Invalid finalization value"),
> 42:             new TestData(new String[] { "--finalization", "azerty" },
> 43:                          "Invalid finalization value"),

A nit, but can the new, space-separated option be added at the end, instead of 
in the middle of the pre-existing items?

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

PR Review: https://git.openjdk.org/jdk/pull/31928#pullrequestreview-4919824427
PR Review Comment: https://git.openjdk.org/jdk/pull/31928#discussion_r3769200450
PR Review Comment: https://git.openjdk.org/jdk/pull/31928#discussion_r3769135490

Reply via email to