diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java index 6ae8e6c93..ba8235dab 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -203,13 +203,13 @@ public class SuppressionCommentFilter final Matcher tagMatcher = mTagCheckRegexp.matcher(aEvent.getSourceName()); if (tagMatcher.find()) { + if (mTagMessageRegexp != null) { + final Matcher messageMatcher = + mTagMessageRegexp.matcher(aEvent.getMessage()); + return messageMatcher.find(); + } return true; } - if (mTagMessageRegexp != null) { - final Matcher messageMatcher = - mTagMessageRegexp.matcher(aEvent.getMessage()); - return messageMatcher.find(); - } return false; }