From aa4e40e550403d61ce550a2056407fda43a22936 Mon Sep 17 00:00:00 2001 From: Ruslan Diachenko Date: Wed, 26 Aug 2015 22:55:27 +0100 Subject: [PATCH] Issue #1566: partial fix of ReturnCount violations --- .../filters/SuppressionCommentFilter.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; } /**