On Fri, 31 Oct 2025 07:35:18 GMT, Stefan Karlsson <[email protected]> wrote:

>> In the previous fix (https://github.com/openjdk/jdk/pull/28035), I added 
>> `OutputAnalyzer::match(String regexp)`, but it didn't work because by 
>> default regular expressions do not match across newlines.
>> 
>> I fixed this by re-working `OutputAnalyzer::match()`, etc, to use 
>> `Pattern.MULTILINE`.
>> 
>> I tried rerunning the test on macos 26 but couldn't reproduce the condition 
>> in the bug report. However, I added sanity test in this version 
>> (https://github.com/openjdk/jdk/commit/e690e97262575d083017635fa837ab267686bfe9)
>>  and the new regexp seems to catch the output and correctly come to this 
>> part of the test case:
>> 
>> 
>> if (forceBase >= end) {
>>     throw new SkippedException("Failed to force ccs to any of the given 
>> bases. Skipping test.");
>> }
>
> test/lib/jdk/test/lib/process/OutputAnalyzer.java line 359:
> 
>> 357:     private boolean matchesHelper(String s, Pattern pattern) {
>> 358:         return s != null && pattern.matcher(s).find();
>> 359:     }
> 
> This function is named `matchesX` so why is it using `Matcher::find` instead 
> of `Matcher::matches`? That seems confusing.

If it truly is `find` you need, then I think you need to fix the names.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28077#discussion_r2480398463

Reply via email to