diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java index 6e7fe83f6..06311cb78 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -440,17 +440,18 @@ public class SuppressionCommentFilter * @return true if the source of event matches the text of this tag. */ public boolean isMatch(AuditEvent event) { - final Matcher tagMatcher = - tagCheckRegexp.matcher(event.getSourceName()); + boolean match = false; + final Matcher tagMatcher = tagCheckRegexp.matcher(event.getSourceName()); if (tagMatcher.find()) { if (tagMessageRegexp != null) { - final Matcher messageMatcher = - tagMessageRegexp.matcher(event.getMessage()); - return messageMatcher.find(); + final Matcher messageMatcher = tagMessageRegexp.matcher(event.getMessage()); + match = messageMatcher.find(); + } + else { + match = true; } - return true; } - return false; + return match; } /**