diff options
author | David Gageot <david@gageot.net> | 2012-04-24 10:12:28 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-04-27 14:58:59 +0200 |
commit | 872b3923f80d9a2bcc13713f41cf801f2a7024eb (patch) | |
tree | 2ef0a5003c3becb1b0e53d5683e60ed3c9f759b5 /plugins/sonar-cpd-plugin | |
parent | 4b262d15878b31c6c2c7efd8236fb5c65093ba11 (diff) | |
download | sonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.tar.gz sonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.zip |
Remove warnings
Diffstat (limited to 'plugins/sonar-cpd-plugin')
-rw-r--r-- | plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java | 23 | ||||
-rw-r--r-- | plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/PmdEngineTest.java | 11 |
2 files changed, 19 insertions, 15 deletions
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java index 2708f843d17..9b734290990 100644 --- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java +++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java @@ -19,13 +19,17 @@ */ package org.sonar.plugins.cpd; -import org.sonar.api.*; +import com.google.common.collect.ImmutableList; +import org.sonar.api.BatchExtension; +import org.sonar.api.CoreProperties; +import org.sonar.api.Properties; +import org.sonar.api.Property; import org.sonar.api.PropertyType; +import org.sonar.api.SonarPlugin; import org.sonar.plugins.cpd.decorators.DuplicationDensityDecorator; import org.sonar.plugins.cpd.decorators.SumDuplicationsDecorator; import org.sonar.plugins.cpd.index.IndexFactory; -import java.util.Arrays; import java.util.List; @Properties({ @@ -92,12 +96,15 @@ import java.util.List; }) public final class CpdPlugin extends SonarPlugin { - public List getExtensions() { - return Arrays.asList(CpdSensor.class, SumDuplicationsDecorator.class, DuplicationDensityDecorator.class, - IndexFactory.class, - SonarEngine.class, - PmdEngine.class, - SonarBridgeEngine.class); + public List<Class<? extends BatchExtension>> getExtensions() { + return ImmutableList.of( + CpdSensor.class, + SumDuplicationsDecorator.class, + DuplicationDensityDecorator.class, + IndexFactory.class, + SonarEngine.class, + PmdEngine.class, + SonarBridgeEngine.class); } } diff --git a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/PmdEngineTest.java b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/PmdEngineTest.java index 54a86f56063..3bbedf7f787 100644 --- a/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/PmdEngineTest.java +++ b/plugins/sonar-cpd-plugin/src/test/java/org/sonar/plugins/cpd/PmdEngineTest.java @@ -56,8 +56,7 @@ public class PmdEngineTest { public void defaultMinimumTokens() { Project project = createJavaProject().setConfiguration(new PropertiesConfiguration()); - PmdEngine engine = new PmdEngine(); - assertEquals(CoreProperties.CPD_MINIMUM_TOKENS_DEFAULT_VALUE, engine.getMinimumTokens(project)); + assertEquals(CoreProperties.CPD_MINIMUM_TOKENS_DEFAULT_VALUE, PmdEngine.getMinimumTokens(project)); } @Test @@ -66,8 +65,7 @@ public class PmdEngineTest { conf.setProperty("sonar.cpd.minimumTokens", "33"); Project project = createJavaProject().setConfiguration(conf); - PmdEngine engine = new PmdEngine(); - assertEquals(33, engine.getMinimumTokens(project)); + assertEquals(33, PmdEngine.getMinimumTokens(project)); } @Test @@ -79,9 +77,8 @@ public class PmdEngineTest { Project phpProject = createPhpProject().setConfiguration(conf); Project javaProject = createJavaProject().setConfiguration(conf); - PmdEngine engine = new PmdEngine(); - assertEquals(100, engine.getMinimumTokens(javaProject)); - assertEquals(33, engine.getMinimumTokens(phpProject)); + assertEquals(100, PmdEngine.getMinimumTokens(javaProject)); + assertEquals(33, PmdEngine.getMinimumTokens(phpProject)); } private Project createJavaProject() { |