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 | |
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)
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java index 7675da8cd7d..bfa5b2a2213 100644 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java +++ b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/SonarWayWithFindbugsProfile.java @@ -26,7 +26,7 @@ import org.sonar.api.resources.Java; public class SonarWayWithFindbugsProfile extends XMLProfileDefinition { public SonarWayWithFindbugsProfile() { - super(RulesProfile.SONAR_WAY_NAME, Java.KEY, SunConventionsProfile.class.getClassLoader(), "org/sonar/plugins/checkstyle/profile-sonar-way.xml"); + super(RulesProfile.SONAR_WAY_FINDBUGS_NAME, Java.KEY, SonarWayWithFindbugsProfile.class.getClassLoader(), "org/sonar/plugins/checkstyle/profile-sonar-way.xml"); } } 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()); + } } } } |