diff options
author | Stephane Gamard <stephane.gamard@sonarsource.com> | 2014-09-04 14:48:05 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@sonarsource.com> | 2014-09-04 14:48:05 +0200 |
commit | a194c7c2a9f827ac42b305304003b77fe79d61c4 (patch) | |
tree | 3646205ed5b08ca0cd4a0cb768496fd4264bc136 /server | |
parent | f3939529fe5296bb24f7aa1eeff989ba5c4e1505 (diff) | |
download | sonarqube-a194c7c2a9f827ac42b305304003b77fe79d61c4.tar.gz sonarqube-a194c7c2a9f827ac42b305304003b77fe79d61c4.zip |
SONAR-5531 - Added required dbClient and IndexClient in IssueService
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java index f1bba567579..258160aba25 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java +++ b/server/sonar-server/src/main/java/org/sonar/server/issue/IssueService.java @@ -52,7 +52,9 @@ import org.sonar.core.resource.ResourceDto; import org.sonar.core.resource.ResourceQuery; import org.sonar.core.rule.RuleDto; import org.sonar.core.user.AuthorizationDao; +import org.sonar.server.db.DbClient; import org.sonar.server.issue.actionplan.ActionPlanService; +import org.sonar.server.search.IndexClient; import org.sonar.server.user.UserSession; import javax.annotation.Nullable; @@ -67,6 +69,9 @@ import java.util.List; */ public class IssueService implements ServerComponent { + private final DbClient dbClient; + private final IndexClient indexClient; + private final DefaultIssueFinder finder; private final IssueWorkflow workflow; private final IssueUpdater issueUpdater; @@ -80,19 +85,38 @@ public class IssueService implements ServerComponent { private final UserFinder userFinder; private final PreviewCache dryRunCache; - + @Deprecated public IssueService(DefaultIssueFinder finder, - IssueWorkflow workflow, - IssueStorage issueStorage, - IssueUpdater issueUpdater, - IssueNotifications issueNotifications, - ActionPlanService actionPlanService, - RuleFinder ruleFinder, - ResourceDao resourceDao, - IssueDao issueDao, - AuthorizationDao authorizationDao, - UserFinder userFinder, - PreviewCache dryRunCache) { + IssueWorkflow workflow, + IssueStorage issueStorage, + IssueUpdater issueUpdater, + IssueNotifications issueNotifications, + ActionPlanService actionPlanService, + RuleFinder ruleFinder, + ResourceDao resourceDao, + IssueDao issueDao, + AuthorizationDao authorizationDao, + UserFinder userFinder, + PreviewCache dryRunCache) { + this(null, null, finder, workflow, issueStorage, issueUpdater, issueNotifications, actionPlanService, + ruleFinder, resourceDao, issueDao, authorizationDao, userFinder, dryRunCache); + } + + public IssueService(DbClient dbClient, IndexClient indexClient, + DefaultIssueFinder finder, + IssueWorkflow workflow, + IssueStorage issueStorage, + IssueUpdater issueUpdater, + IssueNotifications issueNotifications, + ActionPlanService actionPlanService, + RuleFinder ruleFinder, + ResourceDao resourceDao, + IssueDao issueDao, + AuthorizationDao authorizationDao, + UserFinder userFinder, + PreviewCache dryRunCache) { + this.dbClient = dbClient; + this.indexClient = indexClient; this.finder = finder; this.workflow = workflow; this.issueStorage = issueStorage; @@ -219,7 +243,7 @@ public class IssueService implements ServerComponent { } public DefaultIssue createManualIssue(String componentKey, RuleKey ruleKey, @Nullable Integer line, @Nullable String message, @Nullable String severity, - @Nullable Double effortToFix, UserSession userSession) { + @Nullable Double effortToFix, UserSession userSession) { verifyLoggedIn(userSession); ResourceDto component = resourceDao.getResource(ResourceQuery.create().setKey(componentKey)); ResourceDto project = resourceDao.getRootProjectByComponentKey(componentKey); |