diff options
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()); + } } } } |