aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-02-09 18:30:50 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-02-11 16:55:31 +0100
commit85b3058678d7a5d7508f44cc5e40d6c27f255be4 (patch)
tree85cceeb50168c1802d6a66823a55c07622c8db31
parent376dadea6735cf4e2004e11cc7c9b137bbdaa907 (diff)
downloadsonarqube-85b3058678d7a5d7508f44cc5e40d6c27f255be4.tar.gz
sonarqube-85b3058678d7a5d7508f44cc5e40d6c27f255be4.zip
SONAR-6065 Facets on components are always sticky, but hidden in UI if needed
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java24
1 files changed, 1 insertions, 23 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
index e0473ca06bf..ffbbb656367 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java
@@ -82,9 +82,6 @@ public class IssueIndex extends BaseIndex {
IssueFilterParameters.CREATED_AT);
// TODO to be documented
- private static final String FILTER_COMPONENT_ROOT = "__componentRoot";
-
- // TODO to be documented
// TODO move to Facets ?
private static final String FACET_SUFFIX_MISSING = "_missing";
@@ -249,11 +246,10 @@ public class IssueIndex extends BaseIndex {
FilterBuilder projectFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_PROJECT_UUID, query.projectUuids());
FilterBuilder moduleRootFilter = createModuleRootFilter(query.moduleRootUuids());
FilterBuilder moduleFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_MODULE_UUID, query.moduleUuids());
- FilterBuilder directoryRootFilter = createDirectoryRootFilter(query.moduleUuids(), query.directories());
FilterBuilder directoryFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_DIRECTORY_PATH, query.directories());
FilterBuilder fileFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_COMPONENT_UUID, query.fileUuids());
- if (query.onComponentOnly()) {
+ if (BooleanUtils.isTrue(query.onComponentOnly())) {
filters.put(IssueIndexDefinition.FIELD_ISSUE_COMPONENT_UUID, componentFilter);
} else {
filters.put("__view", viewFilter);
@@ -290,24 +286,6 @@ public class IssueIndex extends BaseIndex {
}
@CheckForNull
- private FilterBuilder createDirectoryRootFilter(Collection<String> moduleUuids, Collection<String> directoryPaths) {
- BoolFilterBuilder directoryTop = null;
- FilterBuilder moduleFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_MODULE_UUID, moduleUuids);
- FilterBuilder directoryFilter = createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_DIRECTORY_PATH, directoryPaths);
- if (moduleFilter != null) {
- directoryTop = FilterBuilders.boolFilter();
- directoryTop.must(moduleFilter);
- }
- if (directoryFilter != null) {
- if (directoryTop == null) {
- directoryTop = FilterBuilders.boolFilter();
- }
- directoryTop.must(directoryFilter);
- }
- return directoryTop;
- }
-
- @CheckForNull
private FilterBuilder createViewFilter(Collection<String> viewUuids) {
if (viewUuids.isEmpty()) {
return null;