aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-09-30 15:42:05 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-09-30 16:28:09 +0200
commita40d994889fae249ae7e60af71636ba45648181c (patch)
treeee24855f0beec52f5fe690fdd2bb669ac182e3a5 /sonar-batch
parent94beab46836b4f4e6fa93f735448698180e2ef77 (diff)
downloadsonarqube-a40d994889fae249ae7e60af71636ba45648181c.tar.gz
sonarqube-a40d994889fae249ae7e60af71636ba45648181c.zip
Add rule's default parameters to active rules
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/rule/DefaultActiveRulesLoader.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultActiveRulesLoader.java b/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultActiveRulesLoader.java
index 14c37bf1745..956793fe1a2 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultActiveRulesLoader.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/rule/DefaultActiveRulesLoader.java
@@ -102,7 +102,6 @@ public class DefaultActiveRulesLoader implements ActiveRulesLoader {
Active active = activeList.getActiveList(0);
LoadedActiveRule loadedRule = new LoadedActiveRule();
- Map<String, String> params = new HashMap<>();
loadedRule.setRuleKey(RuleKey.parse(r.getKey()));
loadedRule.setName(r.getName());
@@ -111,6 +110,13 @@ public class DefaultActiveRulesLoader implements ActiveRulesLoader {
loadedRule.setInternalKey(r.getInternalKey());
loadedRule.setTemplateRuleKey(r.getTemplateKey());
+ Map<String, String> params = new HashMap<>();
+
+ for (org.sonarqube.ws.Rules.Rule.Param param : r.getParams().getParamsList()) {
+ params.put(param.getKey(), param.getDefaultValue());
+ }
+
+ // overrides defaultValue if the key is the same
for (Param param : active.getParamsList()) {
params.put(param.getKey(), param.getValue());
}