aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-es
diff options
context:
space:
mode:
authorJacek <jacek.poreda@sonarsource.com>2019-12-20 09:18:25 +0100
committerSonarTech <sonartech@sonarsource.com>2020-01-13 20:46:34 +0100
commit97fd4b10e7e38233c104f0f6e89bb21ddb5ddc84 (patch)
treea7cd14a7e39f7ee8462b8b248d4cb74346b8ff36 /server/sonar-webserver-es
parentad3b762b7220f037e3824f39d3a8ae313ebad1e2 (diff)
downloadsonarqube-97fd4b10e7e38233c104f0f6e89bb21ddb5ddc84.tar.gz
sonarqube-97fd4b10e7e38233c104f0f6e89bb21ddb5ddc84.zip
SONAR-12723 Filter hotspots in api/issues/bulk_change
Diffstat (limited to 'server/sonar-webserver-es')
-rw-r--r--server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java b/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java
index 3b87ea711bf..5142a8ffde0 100644
--- a/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java
+++ b/server/sonar-webserver-es/src/main/java/org/sonar/server/issue/index/IssueQueryFactory.java
@@ -21,6 +21,7 @@ package org.sonar.server.issue.index;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
import java.time.Clock;
import java.time.OffsetDateTime;
import java.time.Period;
@@ -59,6 +60,9 @@ import static com.google.common.collect.Collections2.transform;
import static java.lang.String.format;
import static java.util.Collections.singleton;
import static java.util.Collections.singletonList;
+import static org.sonar.api.issue.Issue.STATUSES;
+import static org.sonar.api.issue.Issue.STATUS_REVIEWED;
+import static org.sonar.api.issue.Issue.STATUS_TO_REVIEW;
import static org.sonar.api.utils.DateUtils.longToDate;
import static org.sonar.api.utils.DateUtils.parseDateOrDateTime;
import static org.sonar.api.utils.DateUtils.parseEndingDateOrDateTime;
@@ -80,6 +84,10 @@ import static org.sonarqube.ws.client.issue.IssuesWsParameters.PARAM_SINCE_LEAK_
public class IssueQueryFactory {
public static final String UNKNOWN = "<UNKNOWN>";
+ public static final List<String> ISSUE_STATUSES = STATUSES.stream()
+ .filter(s -> !s.equals(STATUS_TO_REVIEW))
+ .filter(s -> !s.equals(STATUS_REVIEWED))
+ .collect(ImmutableList.toImmutableList());
private static final ComponentDto UNKNOWN_COMPONENT = new ComponentDto().setUuid(UNKNOWN).setProjectUuid(UNKNOWN);
private final DbClient dbClient;