aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-27 10:33:30 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-01-27 10:33:30 +0100
commitfaea2679e26a93dc6a6d5b05339ef8df1001ff82 (patch)
treeab6bbf05d93649eb9a669ca47e59e239bbb90332
parent867a6d8d59863dcaf638418d828f6c9fe56a808a (diff)
downloadsonarqube-faea2679e26a93dc6a6d5b05339ef8df1001ff82.tar.gz
sonarqube-faea2679e26a93dc6a6d5b05339ef8df1001ff82.zip
SONAR-5023 Description of rule parameters is missing from Quality Profile page
-rw-r--r--sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java b/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java
index 103dec7edc8..8f5e2e64d99 100644
--- a/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java
+++ b/sonar-server/src/main/java/org/sonar/server/startup/RegisterRules.java
@@ -110,6 +110,7 @@ public final class RegisterRules {
for (Rule rule : repository.createRules()) {
updateRuleFromRepositoryInfo(rule, repository);
validateRule(rule, repository.getKey());
+ updateRuleParamsDescription(rule);
ruleByKey.put(rule.getKey(), rule);
registeredRules.add(rule);
}
@@ -159,6 +160,16 @@ public final class RegisterRules {
validateRuleDescription(rule, repositoryKey);
}
+ private void updateRuleParamsDescription(Rule rule) {
+ for (RuleParam param : rule.getParams()) {
+ String desc = StringUtils.defaultIfEmpty(
+ ruleI18nManager.getParamDescription(rule.getRepositoryKey(), rule.getKey(), param.getKey()),
+ param.getDescription()
+ );
+ param.setDescription(desc);
+ }
+ }
+
private void validateRuleRepositoryName(Rule rule, String repositoryKey) {
String nameFromBundle = ruleI18nManager.getName(repositoryKey, rule.getKey());
if (!Strings.isNullOrEmpty(nameFromBundle)) {