On Wed, 27 May 2026 16:14:46 GMT, Alexey Semenyuk <[email protected]> wrote:

>> Alexander Matveev has updated the pull request with a new target base due to 
>> a merge or a rebase. The incremental webrev excludes the unrelated changes 
>> brought in by the merge/rebase. The pull request contains three additional 
>> commits since the last revision:
>> 
>>  - Merge remote-tracking branch 'upstream/master' into JDK-8382025
>>  - 8382025: [lworld] tools/jpackage/share/AsyncTest.java fails with An error 
>> of type -10810 has occurred. [v2]
>>  - 8382025: [lworld] tools/jpackage/share/AsyncTest.java fails with An error 
>> of type -10810 has occurred.
>
> test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java line 1248:
> 
>> 1246: 
>> 1247:     static Optional<Boolean> getConfigBooleanProperty(String 
>> propertyName) {
>> 1248:         return 
>> Optional.ofNullable(getConfigProperty(propertyName)).map(Boolean::valueOf);
> 
> Should we use an alternative "String to Boolean" converter function to avoid 
> changes in test/jdk/tools/jpackage/run_tests.sh?
> 
> Something like:
> 
>     static boolean toBoolean(String str) {
>         if (IS_TRUE.test(str)) {
>             return true;
>         } else if (IS_FALSE.test(str)) {
>             return false;
>         } else {
>             throw new IllegalArgumentException(String.format("Can't parse 
> boolean from [%s]", str));
>         }
>     }
> 
>     private final static Predicate<String> IS_TRUE = 
> Pattern.compile("^(?:y|Y|[y|Y]es|YES|[t|T]rue|TRUE|[1-9]\\d*|)$").asMatchPredicate();
>     private final static Predicate<String> IS_FALSE = 
> Pattern.compile("^(?:n|N|NO|No|no|[f|F]alse|FALSE|0)$").asMatchPredicate();

I think change to run_tests.sh is more convenient, than proposed solution. 
Also, I think we should use `true` to set boolean properties, so we can just 
use `Boolean.getBoolean()` to read them. It is easy to understand, then for 
example -Djpackage.test.SQETest=5 (based on proposed code).

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

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

Reply via email to