From 03e2858a7f3fc0d2d9160a51177bf550ad79e8a1 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Wed, 12 Jan 2022 18:23:33 +0100 Subject: [PATCH] RegExp: really fix order of evaluation in Checker (IDEA-255232) GitOrigin-RevId: 954f19914ae46b7af3a184a09c5d8dc3988ea12f --- .../org/intellij/lang/regexp/intention/CheckRegExpForm.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java index 88fc00e54426..c84b86aeeed7 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java @@ -518,11 +518,12 @@ public final class CheckRegExpForm { setMatches(regExpFile, collectMatches(matcher)); return RegExpMatchResult.MATCHES; } - else if (matcher.find()) { + final boolean hitEnd = matcher.hitEnd(); + if (matcher.find()) { setMatches(regExpFile, collectMatches(matcher)); return RegExpMatchResult.FOUND; } - else if (matcher.hitEnd()) { + else if (hitEnd) { return RegExpMatchResult.INCOMPLETE; } else {