aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-checkstyle-plugin
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2010-09-20 15:31:17 +0000
committersimonbrandhof <simon.brandhof@gmail.com>2010-09-20 15:31:17 +0000
commit6494a6d3e96967cccbb5898abad49bcec3c09693 (patch)
treea648977278d6996471b6d10d1af64927db197524 /plugins/sonar-checkstyle-plugin
parent74635c14aac01f60c2e7c07f79a12fc452ac7db2 (diff)
downloadsonarqube-6494a6d3e96967cccbb5898abad49bcec3c09693.tar.gz
sonarqube-6494a6d3e96967cccbb5898abad49bcec3c09693.zip
Rules API: parameters with default value are automatically activated when a rule is activated (profile console + provided profiles loaded at startup)
Diffstat (limited to 'plugins/sonar-checkstyle-plugin')
-rw-r--r--plugins/sonar-checkstyle-plugin/src/main/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporter.java2
-rw-r--r--plugins/sonar-checkstyle-plugin/src/test/java/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest.java2
-rw-r--r--plugins/sonar-checkstyle-plugin/src/test/resources/org/sonar/plugins/checkstyle/CheckstyleProfileExporterTest/exportParameters.xml1
3 files changed, 2 insertions, 3 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"/>