aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-findbugs-plugin/src
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-04-24 10:12:28 +0200
committerDavid Gageot <david@gageot.net>2012-04-27 14:58:59 +0200
commit872b3923f80d9a2bcc13713f41cf801f2a7024eb (patch)
tree2ef0a5003c3becb1b0e53d5683e60ed3c9f759b5 /plugins/sonar-findbugs-plugin/src
parent4b262d15878b31c6c2c7efd8236fb5c65093ba11 (diff)
downloadsonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.tar.gz
sonarqube-872b3923f80d9a2bcc13713f41cf801f2a7024eb.zip
Remove warnings
Diffstat (limited to 'plugins/sonar-findbugs-plugin/src')
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java27
-rw-r--r--plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java18
2 files changed, 24 insertions, 21 deletions
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
index 070dfbee8bd..cb2da99ec37 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsPlugin.java
@@ -19,10 +19,14 @@
*/
package org.sonar.plugins.findbugs;
-import org.sonar.api.*;
+import com.google.common.collect.ImmutableList;
+import org.sonar.api.CoreProperties;
+import org.sonar.api.Extension;
+import org.sonar.api.Properties;
+import org.sonar.api.Property;
import org.sonar.api.PropertyType;
+import org.sonar.api.SonarPlugin;
-import java.util.ArrayList;
import java.util.List;
@Properties({
@@ -53,15 +57,14 @@ import java.util.List;
public class FindbugsPlugin extends SonarPlugin {
public List<Class<? extends Extension>> getExtensions() {
- List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>();
- list.add(FindbugsSensor.class);
- list.add(FindbugsConfiguration.class);
- list.add(FindbugsExecutor.class);
- list.add(FindbugsRuleRepository.class);
- list.add(FindbugsProfileExporter.class);
- list.add(FindbugsProfileImporter.class);
- list.add(SonarWayWithFindbugsProfile.class);
- list.add(FindbugsMavenInitializer.class);
- return list;
+ return ImmutableList.of(
+ FindbugsSensor.class,
+ FindbugsConfiguration.class,
+ FindbugsExecutor.class,
+ FindbugsRuleRepository.class,
+ FindbugsProfileExporter.class,
+ FindbugsProfileImporter.class,
+ SonarWayWithFindbugsProfile.class,
+ FindbugsMavenInitializer.class);
}
}
diff --git a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
index 90f9f121a9c..84d233f1e16 100644
--- a/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
+++ b/plugins/sonar-findbugs-plugin/src/test/java/org/sonar/plugins/findbugs/FindbugsProfileImporterTest.java
@@ -41,10 +41,10 @@ import static org.junit.Assert.assertThat;
public class FindbugsProfileImporterTest {
- private FindbugsProfileImporter importer = new FindbugsProfileImporter(new FakeRuleFinder());
+ private final FindbugsProfileImporter importer = new FindbugsProfileImporter(new FakeRuleFinder());
@Test
- public void shouldImportPatterns() throws IOException {
+ public void shouldImportPatterns() {
String findbugsConf = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/shouldImportPatterns.xml");
RulesProfile profile = importer.importProfile(new StringReader(findbugsConf), ValidationMessages.create());
@@ -54,7 +54,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void shouldImportCodes() throws IOException {
+ public void shouldImportCodes() {
InputStream input = getClass().getResourceAsStream("/org/sonar/plugins/findbugs/shouldImportCodes.xml");
RulesProfile profile = importer.importProfile(new InputStreamReader(input), ValidationMessages.create());
List<ActiveRule> results = profile.getActiveRules();
@@ -65,7 +65,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void shouldImportCategories() throws IOException {
+ public void shouldImportCategories() {
InputStream input = getClass().getResourceAsStream("/org/sonar/plugins/findbugs/shouldImportCategories.xml");
RulesProfile profile = importer.importProfile(new InputStreamReader(input), ValidationMessages.create());
List<ActiveRule> results = profile.getActiveRules();
@@ -75,7 +75,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void shouldImportConfigurationBugInclude() throws IOException {
+ public void shouldImportConfigurationBugInclude() {
InputStream input = getClass().getResourceAsStream("/org/sonar/plugins/findbugs/findbugs-include.xml");
RulesProfile profile = importer.importProfile(new InputStreamReader(input), ValidationMessages.create());
List<ActiveRule> results = profile.getActiveRules();
@@ -98,7 +98,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void testImportingUncorrectXmlFile() throws IOException {
+ public void testImportingUncorrectXmlFile() {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/uncorrectFindbugsXml.xml");
ValidationMessages messages = ValidationMessages.create();
RulesProfile profile = importer.importProfile(new StringReader(uncorrectFindbugsXml), messages);
@@ -109,7 +109,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void testImportingXmlFileWithUnknownRule() throws IOException {
+ public void testImportingXmlFileWithUnknownRule() {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownRule.xml");
ValidationMessages messages = ValidationMessages.create();
RulesProfile profile = importer.importProfile(new StringReader(uncorrectFindbugsXml), messages);
@@ -120,7 +120,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void testImportingXmlFileWithUnknownCategory() throws IOException {
+ public void testImportingXmlFileWithUnknownCategory() {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownCategory.xml");
ValidationMessages messages = ValidationMessages.create();
RulesProfile profile = importer.importProfile(new StringReader(uncorrectFindbugsXml), messages);
@@ -131,7 +131,7 @@ public class FindbugsProfileImporterTest {
}
@Test
- public void testImportingXmlFileWithUnknownCode() throws IOException {
+ public void testImportingXmlFileWithUnknownCode() {
String uncorrectFindbugsXml = TestUtils.getResourceContent("/org/sonar/plugins/findbugs/findbugsXmlWithUnknownCode.xml");
ValidationMessages messages = ValidationMessages.create();
RulesProfile profile = importer.importProfile(new StringReader(uncorrectFindbugsXml), messages);