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-design-plugin | |
parent | 4b262d15878b31c6c2c7efd8236fb5c65093ba11 (diff) | |
download | sonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.tar.gz sonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.zip |
Remove warnings
Diffstat (limited to 'plugins/sonar-design-plugin')
2 files changed, 20 insertions, 25 deletions
diff --git a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java index cb643053bfa..50805055b42 100644 --- a/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java +++ b/plugins/sonar-design-plugin/src/main/java/org/sonar/plugins/design/DesignPlugin.java @@ -19,8 +19,8 @@ */ package org.sonar.plugins.design; -import java.util.List; - +import com.google.common.collect.ImmutableList; +import org.sonar.api.Extension; import org.sonar.api.SonarPlugin; import org.sonar.plugins.design.batch.FileTangleIndexDecorator; import org.sonar.plugins.design.batch.MavenDependenciesSensor; @@ -34,29 +34,25 @@ import org.sonar.plugins.design.ui.widgets.ChidamberKemererWidget; import org.sonar.plugins.design.ui.widgets.FileDesignWidget; import org.sonar.plugins.design.ui.widgets.PackageDesignWidget; -import com.google.common.collect.Lists; +import java.util.List; public class DesignPlugin extends SonarPlugin { - @SuppressWarnings({"unchecked", "rawtypes"}) - public List getExtensions() { - List extensions = Lists.newArrayList(); - - // Batch - extensions.add(MavenDependenciesSensor.class); - extensions.add(ProjectDsmDecorator.class); - extensions.add(PackageTangleIndexDecorator.class); - extensions.add(FileTangleIndexDecorator.class); - extensions.add(SuspectLcom4DensityDecorator.class); - extensions.add(GwtLibrariesPage.class); - - // UI - extensions.add(GwtDesignPage.class); - extensions.add(DependenciesViewer.class); - extensions.add(FileDesignWidget.class); - extensions.add(PackageDesignWidget.class); - extensions.add(ChidamberKemererWidget.class); - - return extensions; + public List<Class<? extends Extension>> getExtensions() { + return ImmutableList.of( + // Batch + MavenDependenciesSensor.class, + ProjectDsmDecorator.class, + PackageTangleIndexDecorator.class, + FileTangleIndexDecorator.class, + SuspectLcom4DensityDecorator.class, + GwtLibrariesPage.class, + + // UI + GwtDesignPage.class, + DependenciesViewer.class, + FileDesignWidget.class, + PackageDesignWidget.class, + ChidamberKemererWidget.class); } } diff --git a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/DsmSerializerTest.java b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/DsmSerializerTest.java index a0a3b8a28fd..da8a1180289 100644 --- a/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/DsmSerializerTest.java +++ b/plugins/sonar-design-plugin/src/test/java/org/sonar/plugins/design/batch/DsmSerializerTest.java @@ -35,7 +35,7 @@ import static org.junit.Assert.assertThat; public class DsmSerializerTest { @Test - public void serializeEmptyDsm() throws IOException { + public void serializeEmptyDsm() { Dsm dsm = new Dsm(new DirectedGraph()); assertThat(DsmSerializer.serialize(dsm), is("[]")); } @@ -51,7 +51,6 @@ public class DsmSerializerTest { graph.addVertex(bar); graph.addEdge(dep); - Dsm<Resource> dsm = new Dsm<Resource>(graph); DsmManualSorter.sort(dsm, bar, foo); // for test reproductibility String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/plugins/design/batch/DsmSerializerTest/dsm.json")); |