From 872b3923f80d9a2bcc13713f41cf801f2a7024eb Mon Sep 17 00:00:00 2001 From: David Gageot Date: Tue, 24 Apr 2012 10:12:28 +0200 Subject: Remove warnings --- .../org/sonar/plugins/design/DesignPlugin.java | 42 ++++++++++------------ .../plugins/design/batch/DsmSerializerTest.java | 3 +- 2 files changed, 20 insertions(+), 25 deletions(-) (limited to 'plugins/sonar-design-plugin') 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> 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 dsm = new Dsm(graph); DsmManualSorter.sort(dsm, bar, foo); // for test reproductibility String json = IOUtils.toString(getClass().getResourceAsStream("/org/sonar/plugins/design/batch/DsmSerializerTest/dsm.json")); -- cgit v1.2.3