diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-29 21:46:28 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2014-10-29 21:46:28 +0100 |
commit | d00874c660c7c4a3ac1964220b83cd475a653c3f (patch) | |
tree | 924e694d316d85023d265fd4cdd2881eb460700d /plugins/sonar-core-plugin | |
parent | 9b7bcaaf80d652e92d9326367952e7ede77bd44b (diff) | |
download | sonarqube-d00874c660c7c4a3ac1964220b83cd475a653c3f.tar.gz sonarqube-d00874c660c7c4a3ac1964220b83cd475a653c3f.zip |
SONAR-5375 Minor optimization to remove all issues once for a given component
Diffstat (limited to 'plugins/sonar-core-plugin')
-rw-r--r-- | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java index f46e87baf76..27ee9a8ca6f 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/issue/IssueTrackingDecorator.java @@ -25,7 +25,12 @@ import com.google.common.collect.Lists; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.sonar.api.batch.*; +import org.sonar.api.batch.Decorator; +import org.sonar.api.batch.DecoratorBarriers; +import org.sonar.api.batch.DecoratorContext; +import org.sonar.api.batch.DependedUpon; +import org.sonar.api.batch.DependsUpon; +import org.sonar.api.batch.SonarIndex; import org.sonar.api.component.ResourcePerspectives; import org.sonar.api.issue.Issuable; import org.sonar.api.issue.Issue; @@ -69,13 +74,13 @@ public class IssueTrackingDecorator implements Decorator { private final RuleFinder ruleFinder; public IssueTrackingDecorator(IssueCache issueCache, InitialOpenIssuesStack initialOpenIssues, IssueTracking tracking, - LastSnapshots lastSnapshots, SonarIndex index, - IssueHandlers handlers, IssueWorkflow workflow, - IssueUpdater updater, - Project project, - ResourcePerspectives perspectives, - RulesProfile rulesProfile, - RuleFinder ruleFinder) { + LastSnapshots lastSnapshots, SonarIndex index, + IssueHandlers handlers, IssueWorkflow workflow, + IssueUpdater updater, + Project project, + ResourcePerspectives perspectives, + RulesProfile rulesProfile, + RuleFinder ruleFinder) { this.issueCache = issueCache; this.initialOpenIssues = initialOpenIssues; this.tracking = tracking; @@ -107,9 +112,9 @@ public class IssueTrackingDecorator implements Decorator { void doDecorate(Resource resource) { Collection<DefaultIssue> issues = Lists.newArrayList(); for (Issue issue : issueCache.byComponent(resource.getEffectiveKey())) { - issueCache.remove(issue); issues.add((DefaultIssue) issue); } + issueCache.removeAll(resource.getEffectiveKey()); // issues = all the issues created by rule engines during this module scan and not excluded by filters // all the issues that are not closed in db before starting this module scan, including manual issues |