diff options
5 files changed, 3 insertions, 21 deletions
diff --git a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java index b18a198b40a..ab91ee2f647 100644 --- a/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java +++ b/plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java @@ -146,7 +146,7 @@ public class CheckstyleProfileExporter extends ProfileExporter { private void appendRuleParameters(Writer writer, ActiveRule activeRule) throws IOException { for (RuleParam ruleParam : activeRule.getRule().getParams()) { - String value = activeRule.getParameter(ruleParam.getKey(), true); + String value = activeRule.getParameter(ruleParam.getKey()); if (StringUtils.isNotBlank(value)) { appendModuleProperty(writer, ruleParam.getKey(), value); } diff --git a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java index b81557b37b8..a7c4ff76e72 100644 --- a/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java +++ b/plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java @@ -104,7 +104,7 @@ public class CheckstyleProfileExporterTest { .setConfigKey("Checker/JavadocPackage"); rule.createParameter("format"); rule.createParameter("message"); // not set in the profile and no default value => not exported in checkstyle - rule.createParameter("ignore").setDefaultValue("true"); + rule.createParameter("ignore"); profile.activateRule(rule, RulePriority.MAJOR) .setParameter("format", "abcde"); diff --git a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml index 4dc5e48fdcb..461ad4ef4a1 100644 --- a/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml +++ b/plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml @@ -5,7 +5,6 @@ <module name="JavadocPackage"> <property name="severity" value="warning" /> <property name="format" value="abcde" /> - <property name="ignore" value="true" /> </module> <module name="TreeWalker"> <module name="FileContentsHolder"/> diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java index 8a44db85690..86cccee0860 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRule.java @@ -143,23 +143,13 @@ public class ActiveRule implements Cloneable { } public String getParameter(String key) { - return getParameter(key, false); - } - - public String getParameter(String key, boolean useDefaultValueIfNeeded) { if (activeRuleParams != null) { for (ActiveRuleParam param : activeRuleParams) { if (StringUtils.equals(key, param.getKey())) { - return param.getValue(useDefaultValueIfNeeded); + return param.getValue(); } } } - if (useDefaultValueIfNeeded && rule.getParams()!=null) { - RuleParam param = rule.getParam(key); - if (param != null) { - return param.getDefaultValue(); - } - } return null; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java index f3df8e7e945..8691a34458b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/ActiveRuleParam.java @@ -102,13 +102,6 @@ public class ActiveRuleParam implements Cloneable { return value;
}
- public String getValue(boolean useDefaultValueIfNeeded) {
- if (value==null && useDefaultValueIfNeeded) {
- return ruleParam.getDefaultValue();
- }
- return value;
- }
-
public void setValue(String value) {
this.value = value;
}
|