aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-protocol/src
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2018-04-25 15:42:40 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-09 20:20:46 +0200
commit9aa90ae28dc7ce6c22c6e51c6d847c848a30c949 (patch)
tree061c9cad18388c827adca636f7ec842e521de4ff /sonar-scanner-protocol/src
parentfa4019b992510560be8c6d1b51bc2dc2f6b41546 (diff)
downloadsonarqube-9aa90ae28dc7ce6c22c6e51c6d847c848a30c949.tar.gz
sonarqube-9aa90ae28dc7ce6c22c6e51c6d847c848a30c949.zip
Minor refactoring
Diffstat (limited to 'sonar-scanner-protocol/src')
-rw-r--r--sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
index 2fb837b2558..d5e66955ab3 100644
--- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
+++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java
@@ -120,6 +120,19 @@ public class ScannerReportReader {
return file.exists();
}
+ public CloseableIterator<ScannerReport.LineSgnificantCode> readComponentSignificantCode(int fileRef) {
+ File file = fileStructure.fileFor(FileStructure.Domain.SGNIFICANT_CODE, fileRef);
+ if (fileExists(file)) {
+ return Protobuf.readStream(file, ScannerReport.LineSgnificantCode.parser());
+ }
+ return emptyCloseableIterator();
+ }
+
+ public boolean hasSignificantCode(int fileRef) {
+ File file = fileStructure.fileFor(FileStructure.Domain.SGNIFICANT_CODE, fileRef);
+ return fileExists(file);
+ }
+
public CloseableIterator<ScannerReport.SyntaxHighlightingRule> readComponentSyntaxHighlighting(int fileRef) {
File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, fileRef);
if (fileExists(file)) {