aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-04-27 16:45:37 +0200
committerDavid Gageot <david@gageot.net>2012-04-27 16:48:58 +0200
commitbd90fa7d3ec17f825cac80eebd46cf1ee0412ee9 (patch)
tree92a3ff7db9b91d9afe4684cc90a7a0cc5c3e010c
parent1a6a18a5c4e73987a72b8176f398477f13074d29 (diff)
downloadsonarqube-bd90fa7d3ec17f825cac80eebd46cf1ee0412ee9.tar.gz
sonarqube-bd90fa7d3ec17f825cac80eebd46cf1ee0412ee9.zip
Code cleaning : Remove unnecessary casts
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/ProjectPurgePostJob.java2
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/period/DefaultPeriodCleaner.java2
-rw-r--r--plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java2
-rw-r--r--plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java4
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/AccessorVisitor.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/MethodVisitor.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java4
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java12
-rw-r--r--plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/ast/visitor/ClassVisitorTest.java2
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/CaseInsensitiveKeywordsTokenizer.java2
-rw-r--r--sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlDecorator.java4
-rw-r--r--sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlCodeBuilderTest.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/BatchExtensionDictionnary.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenPluginTest.java14
-rw-r--r--sonar-server/src/test/java/org/sonar/server/startup/RegisterRulesTest.java2
-rw-r--r--sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java2
-rw-r--r--sonar-squid/src/main/java/org/sonar/squid/measures/MeanAggregationFormula.java2
18 files changed, 32 insertions, 32 deletions
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/ProjectPurgePostJob.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/ProjectPurgePostJob.java
index adaf87e31aa..b844c588f6c 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/ProjectPurgePostJob.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/ProjectPurgePostJob.java
@@ -35,6 +35,6 @@ public class ProjectPurgePostJob implements PostJob {
}
public void executeOn(final Project project, SensorContext context) {
- purgeTask.purge((long) project.getId());
+ purgeTask.purge(project.getId());
}
}
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/period/DefaultPeriodCleaner.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/period/DefaultPeriodCleaner.java
index e81e3cd30ea..016e11eeceb 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/period/DefaultPeriodCleaner.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/period/DefaultPeriodCleaner.java
@@ -44,7 +44,7 @@ public class DefaultPeriodCleaner implements PeriodCleaner {
}
public void purge(Project project, int projectSnapshotId) {
- clean((long) project.getId());
+ clean(project.getId());
}
public void clean(long projectId) {
diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java
index 41592c05158..0cbb9d251d9 100644
--- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java
+++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/batch/ProjectDsmDecorator.java
@@ -92,7 +92,7 @@ public class ProjectDsmDecorator implements Decorator {
private void addSubProjects(Project project, List<Resource> subProjects) {
for (Project subProject : project.getModules()) {
- Project indexedSubProject = (Project) index.getResource(subProject);
+ Project indexedSubProject = index.getResource(subProject);
if (indexedSubProject != null) {
subProjects.add(indexedSubProject);
}
diff --git a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
index 8c4ddb45286..7524b9d2465 100644
--- a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
+++ b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
@@ -117,9 +117,9 @@ public class PmdProfileImporter extends ProfileImporter {
private List<Element> getChildren(Element parent, String childName, @Nullable Namespace namespace) {
if (namespace == null) {
- return (List<Element>) parent.getChildren(childName);
+ return parent.getChildren(childName);
} else {
- return (List<Element>) parent.getChildren(childName, namespace);
+ return parent.getChildren(childName, namespace);
}
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/AccessorVisitor.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/AccessorVisitor.java
index 37a4ad8d529..8509dcf3195 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/AccessorVisitor.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/AccessorVisitor.java
@@ -126,7 +126,7 @@ public class AccessorVisitor extends JavaAstVisitor {
}
private boolean inspectSetterMethodBody(DetailAST method, DetailAST methodParams, DetailAST methodBody) {
- DetailAST expr = (DetailAST) methodBody.getFirstChild();
+ DetailAST expr = methodBody.getFirstChild();
if (isAstType(expr, TokenTypes.EXPR)) {
DetailAST assignment = expr.findFirstToken(TokenTypes.ASSIGN);
if (assignment != null) {
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/MethodVisitor.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/MethodVisitor.java
index 316c395595e..82abad51099 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/MethodVisitor.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/MethodVisitor.java
@@ -95,7 +95,7 @@ public class MethodVisitor extends JavaAstVisitor {
Parameter argumentType = extractArgumentAndReturnType(child.findFirstToken(TokenTypes.TYPE));
argumentTypes.add(new Parameter(argumentType));
}
- child = (DetailAST) child.getNextSibling();
+ child = child.getNextSibling();
}
return argumentTypes;
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
index e5e68d74070..2c9efe9f064 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/bytecode/asm/AsmMethod.java
@@ -198,11 +198,11 @@ public class AsmMethod extends AsmResource {
}
private boolean isCallToNonStaticInternalField(AsmEdge edge) {
- return edge.getTargetAsmClass() == (AsmClass)getParent() && edge.getUsage() == SourceCodeEdgeUsage.CALLS_FIELD && !((AsmField)edge.getTo()).isStatic();
+ return edge.getTargetAsmClass() == getParent() && edge.getUsage() == SourceCodeEdgeUsage.CALLS_FIELD && !((AsmField) edge.getTo()).isStatic();
}
private boolean isCallToNonStaticInternalMethod(AsmEdge edge) {
- return edge.getTargetAsmClass() == (AsmClass)getParent() && edge.getUsage() == SourceCodeEdgeUsage.CALLS_METHOD && !((AsmMethod)edge.getTo()).isStatic();
+ return edge.getTargetAsmClass() == getParent() && edge.getUsage() == SourceCodeEdgeUsage.CALLS_METHOD && !((AsmMethod) edge.getTo()).isStatic();
}
@Override
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java
index 9e1175faee8..cfffeb395b9 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/DesignBridge.java
@@ -70,9 +70,9 @@ public class DesignBridge extends Bridge {
LOG.debug("{} feedback edges", feedbackEdges.size());
int tangles = cyclesAndFESSolver.getWeightOfFeedbackEdgeSet();
- savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_CYCLES, (double) cyclesAndFESSolver.getCycles().size());
- savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_FEEDBACK_EDGES, (double) feedbackEdges.size());
- savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_TANGLES, (double) tangles);
+ savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_CYCLES, cyclesAndFESSolver.getCycles().size());
+ savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_FEEDBACK_EDGES, feedbackEdges.size());
+ savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_TANGLES, tangles);
savePositiveMeasure(sonarProject, CoreMetrics.PACKAGE_EDGES_WEIGHT, getEdgesWeight(squidPackages));
String dsmJson = serializeDsm(squid, squidPackages, feedbackEdges);
@@ -103,9 +103,9 @@ public class DesignBridge extends Bridge {
Set<Edge> feedbackEdges = solver.getEdges();
int tangles = solver.getWeightOfFeedbackEdgeSet();
- savePositiveMeasure(sonarPackage, CoreMetrics.FILE_CYCLES, (double) cycles.size());
- savePositiveMeasure(sonarPackage, CoreMetrics.FILE_FEEDBACK_EDGES, (double) feedbackEdges.size());
- savePositiveMeasure(sonarPackage, CoreMetrics.FILE_TANGLES, (double) tangles);
+ savePositiveMeasure(sonarPackage, CoreMetrics.FILE_CYCLES, cycles.size());
+ savePositiveMeasure(sonarPackage, CoreMetrics.FILE_FEEDBACK_EDGES, feedbackEdges.size());
+ savePositiveMeasure(sonarPackage, CoreMetrics.FILE_TANGLES, tangles);
savePositiveMeasure(sonarPackage, CoreMetrics.FILE_EDGES_WEIGHT, getEdgesWeight(squidFiles));
String dsmJson = serializeDsm(squid, squidFiles, feedbackEdges);
diff --git a/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/ast/visitor/ClassVisitorTest.java b/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/ast/visitor/ClassVisitorTest.java
index dae1ded5386..4a0544c2766 100644
--- a/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/ast/visitor/ClassVisitorTest.java
+++ b/plugins/sonar-squid-java-plugin/src/test/java/org/sonar/java/ast/visitor/ClassVisitorTest.java
@@ -137,7 +137,7 @@ public class ClassVisitorTest {
@Test
public void testCreateSquidClassFromEmptyPackage() {
- SourceClass squidClass = ClassVisitor.createSourceClass((SourcePackage) new SourcePackage(""), "Squid");
+ SourceClass squidClass = ClassVisitor.createSourceClass(new SourcePackage(""), "Squid");
assertEquals("Squid", squidClass.getKey());
}
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/CaseInsensitiveKeywordsTokenizer.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/CaseInsensitiveKeywordsTokenizer.java
index 00706d9b13d..f7111c3b6e6 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/CaseInsensitiveKeywordsTokenizer.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/CaseInsensitiveKeywordsTokenizer.java
@@ -34,7 +34,7 @@ public class CaseInsensitiveKeywordsTokenizer extends KeywordsTokenizer {
}
public KeywordsTokenizer clone() {
- KeywordsTokenizer clone = (KeywordsTokenizer) super.clone();
+ KeywordsTokenizer clone = super.clone();
clone.setCaseInsensitive(true);
return clone;
}
diff --git a/sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlDecorator.java b/sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlDecorator.java
index c1283646513..8c830560047 100644
--- a/sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlDecorator.java
+++ b/sonar-colorizer/src/main/java/org/sonar/colorizer/HtmlDecorator.java
@@ -32,8 +32,8 @@ public class HtmlDecorator extends Tokenizer {
private HtmlOptions options;
private int lineId;
- private static final int LF = (int) '\n';
- private static final int CR = (int) '\r';
+ private static final int LF = '\n';
+ private static final int CR = '\r';
public HtmlDecorator(HtmlOptions options) {
this.options = options;
diff --git a/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlCodeBuilderTest.java b/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlCodeBuilderTest.java
index e005260494e..1eef540e833 100644
--- a/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlCodeBuilderTest.java
+++ b/sonar-colorizer/src/test/java/org/sonar/colorizer/HtmlCodeBuilderTest.java
@@ -73,7 +73,7 @@ public class HtmlCodeBuilderTest {
assertThat((String) builder.getVariable("foo"), is("yyy"));
builder.setVariable("foo", null);
- assertThat((String) builder.getVariable("foo"), nullValue());
+ assertThat(builder.getVariable("foo"), nullValue());
assertThat((String) builder.getVariable("foo", "default"), is("default"));
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/BatchExtensionDictionnary.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/BatchExtensionDictionnary.java
index 4728a25bea7..d49a7001028 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/BatchExtensionDictionnary.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/BatchExtensionDictionnary.java
@@ -126,7 +126,7 @@ public class BatchExtensionDictionnary {
}
List sortedList = dag.sort();
- return (Collection<T>) Collections2.filter(sortedList, Predicates.in(extensions));
+ return Collections2.filter(sortedList, Predicates.in(extensions));
}
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
index d155b8fe42d..3ec31bbced5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
@@ -162,6 +162,6 @@ public class RuleMeasure extends Measure {
*/
@Deprecated
public static RuleMeasure createForCategory(Metric metric, Integer category, Double value) {
- return (RuleMeasure) new RuleMeasure(metric, null, null, category).setValue(value);
+ return new RuleMeasure(metric, null, null, category).setValue(value);
}
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenPluginTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenPluginTest.java
index ea5fc9f3ef2..9900353cb54 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenPluginTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/batch/maven/MavenPluginTest.java
@@ -196,7 +196,7 @@ public class MavenPluginTest {
MavenPlugin mavenPlugin = MavenPlugin.registerPlugin(pom, "mygroup", "my.artifact", "1.0", true);
assertThat(mavenPlugin, not(nullValue()));
- Plugin plugin = MavenUtils.getPlugin((Collection<Plugin>) pom.getBuildPlugins(), "mygroup", "my.artifact");
+ Plugin plugin = MavenUtils.getPlugin(pom.getBuildPlugins(), "mygroup", "my.artifact");
assertThat(plugin, not(nullValue()));
assertThat(plugin.getVersion(), is("1.0"));
}
@@ -207,11 +207,11 @@ public class MavenPluginTest {
MavenPlugin mavenPlugin = MavenPlugin.registerPlugin(pom, "mygroup", "my.artifact", "1.0", true);
assertThat(mavenPlugin, not(nullValue()));
- Plugin plugin = MavenUtils.getPlugin((Collection<Plugin>) pom.getBuildPlugins(), "mygroup", "my.artifact");
+ Plugin plugin = MavenUtils.getPlugin(pom.getBuildPlugins(), "mygroup", "my.artifact");
assertThat(plugin, not(nullValue()));
assertThat(plugin.getVersion(), is("1.0"));
- Plugin pluginManagement = MavenUtils.getPlugin((Collection<Plugin>) pom.getPluginManagement().getPlugins(), "mygroup", "my.artifact");
+ Plugin pluginManagement = MavenUtils.getPlugin(pom.getPluginManagement().getPlugins(), "mygroup", "my.artifact");
assertThat(pluginManagement, nullValue());
}
@@ -221,11 +221,11 @@ public class MavenPluginTest {
MavenPlugin mavenPlugin = MavenPlugin.registerPlugin(pom, "mygroup", "my.artifact", "1.0", false);
assertThat(mavenPlugin, not(nullValue()));
- Plugin plugin = MavenUtils.getPlugin((Collection<Plugin>) pom.getBuildPlugins(), "mygroup", "my.artifact");
+ Plugin plugin = MavenUtils.getPlugin(pom.getBuildPlugins(), "mygroup", "my.artifact");
assertThat(plugin, not(nullValue()));
assertThat(plugin.getVersion(), is("0.9"));
- Plugin pluginManagement = MavenUtils.getPlugin((Collection<Plugin>) pom.getPluginManagement().getPlugins(), "mygroup", "my.artifact");
+ Plugin pluginManagement = MavenUtils.getPlugin(pom.getPluginManagement().getPlugins(), "mygroup", "my.artifact");
assertThat(pluginManagement, nullValue());
}
@@ -235,7 +235,7 @@ public class MavenPluginTest {
MavenPlugin mavenPlugin = MavenPlugin.registerPlugin(pom, "mygroup", "my.artifact", "1.0", false);
assertThat(mavenPlugin, not(nullValue()));
- Plugin plugin = MavenUtils.getPlugin((Collection<Plugin>) pom.getBuildPlugins(), "mygroup", "my.artifact");
+ Plugin plugin = MavenUtils.getPlugin(pom.getBuildPlugins(), "mygroup", "my.artifact");
assertThat(plugin, not(nullValue()));
assertThat(plugin.getVersion(), is("0.9"));
assertThat(plugin.getDependencies().size(), is(1));
@@ -247,7 +247,7 @@ public class MavenPluginTest {
MavenPlugin mavenPlugin = MavenPlugin.registerPlugin(pom, "mygroup", "my.artifact", "1.0", false);
assertThat(mavenPlugin, not(nullValue()));
- Plugin plugin = MavenUtils.getPlugin((Collection<Plugin>) pom.getBuildPlugins(), "mygroup", "my.artifact");
+ Plugin plugin = MavenUtils.getPlugin(pom.getBuildPlugins(), "mygroup", "my.artifact");
assertThat(plugin, not(nullValue()));
assertThat(plugin.getVersion(), is("0.9"));
assertThat(plugin.getDependencies().size(), is(1));
diff --git a/sonar-server/src/test/java/org/sonar/server/startup/RegisterRulesTest.java b/sonar-server/src/test/java/org/sonar/server/startup/RegisterRulesTest.java
index fad5083e838..380b6cf8bda 100644
--- a/sonar-server/src/test/java/org/sonar/server/startup/RegisterRulesTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/startup/RegisterRulesTest.java
@@ -77,7 +77,7 @@ public class RegisterRulesTest extends AbstractDbUnitTestCase {
setupData("shared");
task.start();
- List<Rule> rules = (List<Rule>) getSession()
+ List<Rule> rules = getSession()
.createQuery("from " + Rule.class.getSimpleName() + " where pluginName<>'fake'")
.getResultList();
assertThat(rules.size(), greaterThan(0));
diff --git a/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java b/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
index eb83b805941..4ff249519a7 100644
--- a/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/ui/ViewsTest.java
@@ -69,7 +69,7 @@ public class ViewsTest {
final Views views = new Views(VIEWS);
List resourceViewers = views.getPages(NavigationSection.RESOURCE_TAB);
assertThat(resourceViewers.size(), is(1 + 4 /* default */));
- assertThat(resourceViewers.contains(new ViewProxy((View) FAKE_TAB)), is(true));
+ assertThat(resourceViewers.contains(new ViewProxy(FAKE_TAB)), is(true));
}
@Test
diff --git a/sonar-squid/src/main/java/org/sonar/squid/measures/MeanAggregationFormula.java b/sonar-squid/src/main/java/org/sonar/squid/measures/MeanAggregationFormula.java
index a16643b028d..1cccabd96bb 100644
--- a/sonar-squid/src/main/java/org/sonar/squid/measures/MeanAggregationFormula.java
+++ b/sonar-squid/src/main/java/org/sonar/squid/measures/MeanAggregationFormula.java
@@ -29,7 +29,7 @@ public class MeanAggregationFormula implements AggregationFormula {
return 0;
}
SumAggregationFormula sumFormula = new SumAggregationFormula();
- return sumFormula.aggregate(metric, measurables) / (double) measurables.size();
+ return sumFormula.aggregate(metric, measurables) / measurables.size();
}
}