Skip to content

Reset Matcher state on match failure#205

Open
cushon wants to merge 1 commit into
google:masterfrom
cushon:reset
Open

Reset Matcher state on match failure#205
cushon wants to merge 1 commit into
google:masterfrom
cushon:reset

Conversation

@cushon
Copy link
Copy Markdown
Contributor

@cushon cushon commented May 22, 2026

Ensure that when a match operation (find, matches, lookingAt) fails, the matcher's hasMatch state is reset to false. This prevents subsequent calls to group(), start(), end() from returning stale match data from previous successful matches, and instead correctly throws IllegalStateException.

Ensure that when a match operation (`find`, `matches`, `lookingAt`) fails, the matcher's hasMatch state is reset to false. This prevents subsequent calls to `group()`, `start()`, `end()` from returning stale match data from previous successful matches, and instead correctly throws `IllegalStateException`.

* Closes google#200
* Closes google#201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant