use of org.sonar.scanner.protocol.output.ScannerReport.LineSgnificantCode in project sonarqube by SonarSource.
the class SignificantCodeRepository method toArray.
private static LineRange[] toArray(CloseableIterator<LineSgnificantCode> lineRanges, int numLines) {
LineRange[] ranges = new LineRange[numLines];
LineSgnificantCode currentLine = null;
for (int i = 0; i < numLines; i++) {
if (currentLine == null) {
if (!lineRanges.hasNext()) {
break;
}
currentLine = lineRanges.next();
}
if (currentLine.getLine() == i + 1) {
ranges[i] = new LineRange(currentLine.getStartOffset(), currentLine.getEndOffset());
currentLine = null;
}
}
return ranges;
}
Aggregations