On Wed, 27 May 2026 21:22:41 GMT, Alexander Matveev <[email protected]> 
wrote:

>> `Boolean.valueOf()` returns "false" for "1", "yes", "no", "ttrue", "off", 
>> "on" string values. You think it is a good way to handle user input?
>> 
>>> It is easy to understand, then for example -Djpackage.test.SQETest=5 (based 
>>> on proposed code)
>> 
>> Feel free to adjust the regexp to make it fail on the input you think is 
>> misleading.
>
> Yes, it is a good way to handle it. Any boolean properties should be "true" 
> for `true` and `false` for anything else. See [1]. Also, I think it standard 
> across JDK to have boolean properties set to "true". See 
> `-Djava.awt.headless=true` for example. Why jpackage tests should accept 
> something else? I think it will be confusing to support other values for 
> `true`.
> 
> [1] 
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Boolean.html#getBoolean(java.lang.String)

I don't mind the jpackage test lib being as strict on the values of its 
properties as other JDK components. I just don't want it to silently ignore 
invalid input or, even worse, interpret it in an unexpected way.

The way `Boolean.valueOf()` operates is not the right fit for handling user 
input.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31265#discussion_r3314171980

Reply via email to