diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2018-07-30 15:41:11 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-08-02 20:21:35 +0200 |
commit | c3e6d15ace5c06b0ffa03238158895631e83e8a1 (patch) | |
tree | 45269506c11bf4cef2e7cef579a249bb709c031f /server/sonar-ce-task-projectanalysis | |
parent | 5a9d2364785090379ad5e59a78b061f9d8e2866e (diff) | |
download | sonarqube-c3e6d15ace5c06b0ffa03238158895631e83e8a1.tar.gz sonarqube-c3e6d15ace5c06b0ffa03238158895631e83e8a1.zip |
Fix Quality flaw in CE ComponentTreeBuilder
Diffstat (limited to 'server/sonar-ce-task-projectanalysis')
-rw-r--r-- | server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java index de1daa2c153..427bb87bd52 100644 --- a/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java +++ b/server/sonar-ce-task-projectanalysis/src/main/java/org/sonar/ce/task/projectanalysis/component/ComponentTreeBuilder.java @@ -21,13 +21,13 @@ package org.sonar.ce.task.projectanalysis.component; import java.util.List; import java.util.function.Function; -import java.util.stream.Collectors; import javax.annotation.CheckForNull; import javax.annotation.Nullable; +import org.sonar.ce.task.projectanalysis.analysis.Branch; +import org.sonar.core.util.stream.MoreCollectors; import org.sonar.db.component.SnapshotDto; import org.sonar.scanner.protocol.output.ScannerReport; import org.sonar.scanner.protocol.output.ScannerReport.Component.FileStatus; -import org.sonar.ce.task.projectanalysis.analysis.Branch; import org.sonar.server.project.Project; import static com.google.common.base.MoreObjects.firstNonNull; @@ -88,7 +88,7 @@ public class ComponentTreeBuilder { .stream() .map(scannerComponentSupplier::apply) .map(c -> buildComponent(c, parentModule, projectScmPath)) - .collect(Collectors.toList()); + .collect(MoreCollectors.toList(component.getChildRefCount())); } private ComponentImpl buildComponent(ScannerReport.Component component, ScannerReport.Component closestModule, |