RFR: 8324126: Error message for mistyping -XX:+Unlock...Options is not helpful [v3]

David Holmes dholmes at openjdk.org
Wed Jan 31 06:21:01 UTC 2024


On Mon, 29 Jan 2024 21:05:46 GMT, Sonia Zaldana Calles <szaldana at openjdk.org> wrote:

>> If we run the VM option to unlock experimental vm options without the preceding ‘+’, the error message is not very helpful: 
>> 
>> ```Error: VM option 'UnlockExperimentalVMOptions' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.```
>> 
>> With the proposed change, we should see a more descriptive error message, namely the lack of a +/- sign. 
>> 
>> ```Missing +/- setting for VM option 'UnlockExperimentalVMOptions'```
>> 
>> Testing: runtime/commandLine regression tests pass. Also added a regression test to verify expected behaviour.
>> 
>> Edit (Jan 30): 
>> The expected output is both the unlock message and the well-formed error: 
>> 
>> ```Error: VM option 'UnlockExperimentalVMOptions' is experimental and must be enabled via -XX:+UnlockExperimentalVMOptions.
>> Error: The unlock option must precede 'UnlockExperimentalVMOptions'.
>> Missing +/- setting for VM option 'UnlockExperimentalVMOptions'
>> Error: Could not create the Java Virtual Machine.
>> Error: A fatal exception has occurred. Program will exit.
>
> Sonia Zaldana Calles has updated the pull request incrementally with one additional commit since the last revision:
> 
>   restoring end of file

Thanks. Looks good.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/17575#pullrequestreview-1852967289


More information about the hotspot-runtime-dev mailing list