diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-08-13 17:44:16 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-21 20:21:04 +0200 |
commit | 2c6a570b99b5813354b0a26ce6110c676d950a84 (patch) | |
tree | 3345f959c42520f186c5bb980c36553d25f108d3 /sonar-scanner-engine | |
parent | a48c1dadaf6a81549917bdca8de95706b0941a61 (diff) | |
download | sonarqube-2c6a570b99b5813354b0a26ce6110c676d950a84.tar.gz sonarqube-2c6a570b99b5813354b0a26ce6110c676d950a84.zip |
SONAR-8368 use Stream instead of Iterable in Tracking class
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/LocalIssueTracking.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/LocalIssueTracking.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/LocalIssueTracking.java index ebff1468f42..1e2913c8d08 100644 --- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/LocalIssueTracking.java +++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/issue/tracking/LocalIssueTracking.java @@ -28,6 +28,7 @@ import java.util.Date; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.stream.Stream; import javax.annotation.CheckForNull; import javax.annotation.Nullable; import org.sonar.api.batch.ScannerSide; @@ -205,20 +206,20 @@ public class LocalIssueTracking { } } - private void addUnmatchedFromServer(Iterable<ServerIssueFromWs> unmatchedIssues, Collection<TrackedIssue> mergeTo, String componentKey) { - for (ServerIssueFromWs unmatchedIssue : unmatchedIssues) { + private void addUnmatchedFromServer(Stream<ServerIssueFromWs> unmatchedIssues, Collection<TrackedIssue> mergeTo, String componentKey) { + unmatchedIssues.forEach(unmatchedIssue -> { org.sonar.scanner.protocol.input.ScannerInput.ServerIssue unmatchedPreviousIssue = unmatchedIssue.getDto(); TrackedIssue unmatched = IssueTransformer.toTrackedIssue(unmatchedPreviousIssue, componentKey); updateUnmatchedIssue(unmatched); mergeTo.add(unmatched); - } + }); } - private static void addUnmatchedFromReport(Iterable<TrackedIssue> rawIssues, Collection<TrackedIssue> trackedIssues, Date analysisDate) { - for (TrackedIssue rawIssue : rawIssues) { + private static void addUnmatchedFromReport(Stream<TrackedIssue> rawIssues, Collection<TrackedIssue> trackedIssues, Date analysisDate) { + rawIssues.forEach(rawIssue -> { rawIssue.setCreationDate(analysisDate); trackedIssues.add(rawIssue); - } + }); } private void addIssuesOnDeletedComponents(Collection<TrackedIssue> issues, String componentKey) { |