use of org.drools.verifier.api.reporting.CheckType in project kie-wb-common by kiegroup.
the class IssuesSet method mergeIssues.
private Optional<Issue> mergeIssues(final List<Issue> issues, final CheckType typeToMerge) {
Set<Issue> issuesToMerge = issues.stream().filter(issue -> issue.getCheckType() == typeToMerge).collect(Collectors.toSet());
Set<Integer> affectedRows = issuesToMerge.stream().flatMap(issue -> issue.getRowNumbers().stream()).sorted().collect(Collectors.toSet());
return issuesToMerge.stream().findFirst().map(issue -> new Issue(issue.getSeverity(), typeToMerge, affectedRows));
}
Aggregations