aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server/src
diff options
context:
space:
mode:
authorDaniel Schwarz <daniel.schwarz@sonarsource.com>2017-07-27 16:38:49 +0200
committerDaniel Schwarz <bartfastiel@users.noreply.github.com>2017-08-09 15:09:54 +0200
commit80e1ecb8fe24852295c0170823e5ee4a91af4a68 (patch)
tree36000d47bb600598359a200ec5cf0da39e9862d0 /server/sonar-server/src
parent01472db102cb0d3128354011802dd4b1648ff9b5 (diff)
downloadsonarqube-80e1ecb8fe24852295c0170823e5ee4a91af4a68.tar.gz
sonarqube-80e1ecb8fe24852295c0170823e5ee4a91af4a68.zip
SONAR-8798 fix storing rule key in RuleExtensionDoc
Diffstat (limited to 'server/sonar-server/src')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/index/IssueIndex.java3
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java4
3 files changed, 4 insertions, 7 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java b/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java
index 2ace22b9469..54499ab8364 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/es/BaseDoc.java
@@ -106,10 +106,6 @@ public abstract class BaseDoc {
fields.put(key, value);
}
- public void setField(String key, @Nullable Date value) {
- fields.put(key, value == null ? null : dateToEpochSeconds(value));
- }
-
public Map<String, Object> getFields() {
return fields;
}
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 28494d67c94..75a172984e1 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
@@ -403,7 +403,8 @@ public class IssueIndex {
filters.put(IssueIndexDefinition.FIELD_ISSUE_TYPE, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_TYPE, query.types()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_RESOLUTION, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_RESOLUTION, query.resolutions()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_AUTHOR_LOGIN, query.authors()));
- filters.put(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, query.rules()));
+ filters.put(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_RULE_KEY,
+ query.rules().stream().map(String::valueOf).collect(MoreCollectors.toList(query.rules().size()))));
filters.put(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_SEVERITY, query.severities()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_STATUS, createTermsFilter(IssueIndexDefinition.FIELD_ISSUE_STATUS, query.statuses()));
filters.put(IssueIndexDefinition.FIELD_ISSUE_ORGANIZATION_UUID, createTermFilter(IssueIndexDefinition.FIELD_ISSUE_ORGANIZATION_UUID, query.organizationUuid()));
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
index e0317b989c8..50f64675c0b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleExtensionDoc.java
@@ -54,11 +54,11 @@ public class RuleExtensionDoc extends BaseDoc {
}
public RuleKey getRuleKey() {
- return getField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY);
+ return RuleKey.parse(getField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY));
}
public RuleExtensionDoc setRuleKey(RuleKey ruleKey) {
- setField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY, ruleKey);
+ setField(RuleIndexDefinition.FIELD_RULE_EXTENSION_RULE_KEY, String.valueOf(ruleKey));
return this;
}