RFR: 8281560: Matcher.hitEnd returns unexpected results in presence of CANON_EQ flag. [v2]

Jaikiran Pai jpai at openjdk.java.net
Tue Mar 8 03:54:07 UTC 2022


On Mon, 7 Mar 2022 22:29:29 GMT, Ian Graves <igraves at openjdk.org> wrote:

>> Fixing a bug in `NFCCharProperty` where code falling through an if-statement can prematurely set the matcher's `hitEnd` field to true.
>
> Ian Graves has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:
> 
>  - merging master
>  - Catching erronious setting of matcher.hitEnd

test/jdk/java/util/regex/RegExTest.java line 4568:

> 4566: 
> 4567:         var matcher1 = Pattern.compile(pat1).matcher(testInput);
> 4568:         var matcher2 = Pattern.compile(pat2).matcher(testInput);

Hello Ian,
The JBS issue notes that the bug is only noticed when the `Pattern.CANON_EQ` is used. The javadoc of this `CANON_EQ` states that this isn't enabled by default. Do you think this test should also include matchers which use Pattern(s) with this `CANON_EQ` explicitly enabled?

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

PR: https://git.openjdk.java.net/jdk/pull/7466


More information about the core-libs-dev mailing list