diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-08 09:47:21 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-08 09:47:21 +0000 |
commit | 88495df471775df6f4f725e63bf25d151f584893 (patch) | |
tree | 7465f48e66032ff9e8ff50c5546c175dfbf1565b /sonar-server | |
parent | 2c41b392b19680ff60b3096863e6283a9a58cad1 (diff) | |
download | sonarqube-88495df471775df6f4f725e63bf25d151f584893.tar.gz sonarqube-88495df471775df6f4f725e63bf25d151f584893.zip |
SONAR-440 Warning when some rules are not imported from a checkstyle and/or PMD configuration file(s)
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java b/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java index 02dc2b0bf2d..ed5c23fe520 100644 --- a/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java +++ b/sonar-server/src/main/java/org/sonar/server/rules/ProfilesConsole.java @@ -97,7 +97,12 @@ public final class ProfilesConsole implements ServerComponent { } else { ActiveRule activeRule = profile.activateRule(rule, rulePrototype.getPriority()); for (Map.Entry<String, String> entry : rulePrototype.getParameters().entrySet()) { - activeRule.setParameter(entry.getKey(), entry.getValue()); + if (rule.getParam(entry.getKey())==null) { + messages.addWarning("profiles.missingRuleParameter", "The rule " + rulePrototype + " has no parameter named '" + entry.getKey() + "'."); + + } else { + activeRule.setParameter(entry.getKey(), entry.getValue()); + } } } } |