aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-cobertura-plugin/src/main/java
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-11-25 10:40:53 +0100
committerFabrice Bellingard <bellingard@gmail.com>2011-11-25 10:42:09 +0100
commit07dbf1697c830277934eed8ddb9cd5df1161ed97 (patch)
tree36417201472dbf3e069eae2b1e8fd4169b4d7532 /plugins/sonar-cobertura-plugin/src/main/java
parent36c7fe808ee079ae8ed82b6d55930666a71e8663 (diff)
downloadsonarqube-07dbf1697c830277934eed8ddb9cd5df1161ed97.tar.gz
sonarqube-07dbf1697c830277934eed8ddb9cd5df1161ed97.zip
Fix some violations
Diffstat (limited to 'plugins/sonar-cobertura-plugin/src/main/java')
-rw-r--r--plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaMavenPluginHandler.java19
1 files changed, 15 insertions, 4 deletions
diff --git a/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaMavenPluginHandler.java b/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaMavenPluginHandler.java
index 3e46998a784..38dfc27d868 100644
--- a/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaMavenPluginHandler.java
+++ b/plugins/sonar-cobertura-plugin/src/main/java/org/sonar/plugins/cobertura/CoberturaMavenPluginHandler.java
@@ -24,11 +24,18 @@ import org.sonar.api.CoreProperties;
import org.sonar.api.batch.maven.MavenPlugin;
import org.sonar.api.batch.maven.MavenPluginHandler;
import org.sonar.api.batch.maven.MavenSurefireUtils;
+import org.sonar.api.config.Settings;
import org.sonar.api.resources.Project;
import org.sonar.plugins.cobertura.api.CoberturaUtils;
public class CoberturaMavenPluginHandler implements MavenPluginHandler {
+ private Settings settings;
+
+ public CoberturaMavenPluginHandler(Settings settings) {
+ this.settings = settings;
+ }
+
public String getGroupId() {
return CoberturaUtils.COBERTURA_GROUP_ID;
}
@@ -65,10 +72,14 @@ public class CoberturaMavenPluginHandler implements MavenPluginHandler {
}
coberturaPlugin.addParameter("instrumentation/excludes/exclude", pattern);
}
+ String maxmem = "";
// http://jira.codehaus.org/browse/SONAR-2897: there used to be a typo in the parameter name (was "sonar.cobertura.maxmen")
- coberturaPlugin.setParameter(
- "maxmem",
- project.getConfiguration().getString(CoreProperties.COBERTURA_MAXMEM_PROPERTY,
- project.getConfiguration().getString("sonar.cobertura.maxmen", CoreProperties.COBERTURA_MAXMEM_DEFAULT_VALUE)));
+ if (settings.hasKey("sonar.cobertura.maxmen")) {
+ maxmem = settings.getString("sonar.cobertura.maxmen");
+ } else {
+ // use the "normal" key
+ maxmem = settings.getString(CoreProperties.COBERTURA_MAXMEM_PROPERTY);
+ }
+ coberturaPlugin.setParameter("maxmem", maxmem);
}
}