Fix CheckStyle false positive.
@@ -1242,10 +1242,10 @@ public class Report implements Iterable<Issue>, Serializable {
Collection<Predicate<Issue>> filters = new ArrayList<>();
for (String pattern : patterns) {
filters.add(issueToFilter -> Pattern.compile(pattern, Pattern.DOTALL)
- .matcher(propertyToFilter.apply(issueToFilter)).find() == (type == FilterType.INCLUDE));
+ .matcher(propertyToFilter.apply(issueToFilter)).find() == isIncludeFilter(type));
}
- if (type == FilterType.INCLUDE) {
+ if (isIncludeFilter(type)) {
includeFilters.addAll(filters);
}
else {
@@ -1253,6 +1253,10 @@ public class Report implements Iterable<Issue>, Serializable {
}
}
+ private boolean isIncludeFilter(final FilterType type) {
+ return type == FilterType.INCLUDE;
+ }
+
/**
* Create a IssueFilter. Combine by default all includes with or and all excludes with and.
*
