use of org.sonarsource.sonarlint.core.client.api.common.analysis.IssueLocation in project sonarlint-intellij by SonarSource.
the class IssueProcessor method transformFlows.
private List<LiveIssue.Flow> transformFlows(PsiFile psiFile, List<Issue.Flow> flows, String rule) {
List<LiveIssue.Flow> transformedFlows = new LinkedList<>();
for (Issue.Flow f : flows) {
List<LiveIssue.IssueLocation> newLocations = new LinkedList<>();
for (IssueLocation loc : f.locations()) {
RangeMarker range;
try {
range = matcher.match(psiFile, loc);
} catch (Exception e) {
LOGGER.error("Error finding secondary location for issue", e, rule, String.valueOf(loc.getStartLine()), String.valueOf(loc.getStartLineOffset()), String.valueOf(loc.getEndLine()), String.valueOf(loc.getEndLineOffset()));
return Collections.emptyList();
}
newLocations.add(new LiveIssue.IssueLocation(range, loc.getMessage()));
}
LiveIssue.Flow newFlow = new LiveIssue.Flow(newLocations);
transformedFlows.add(newFlow);
}
return transformedFlows;
}
Aggregations