From 9aa90ae28dc7ce6c22c6e51c6d847c848a30c949 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Wed, 25 Apr 2018 15:42:40 +0200 Subject: Minor refactoring --- .../sonar/scanner/protocol/output/ScannerReportReader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'sonar-scanner-protocol') 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 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 readComponentSyntaxHighlighting(int fileRef) { File file = fileStructure.fileFor(FileStructure.Domain.SYNTAX_HIGHLIGHTINGS, fileRef); if (fileExists(file)) { -- cgit v1.2.3