summaryrefslogtreecommitdiffstats
path: root/plugins/sonar-findbugs-plugin
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-25 18:10:45 +0000
committerGodin <mandrikov@gmail.com>2010-11-25 18:10:45 +0000
commitdfb53e555565a7fbde113db0cccc93826d1f96a0 (patch)
tree1506351f591204d104b4dda5f5d541152a83ca7a /plugins/sonar-findbugs-plugin
parent8e4f854d97a1c60ee20b32f5611627d0a924402a (diff)
downloadsonarqube-dfb53e555565a7fbde113db0cccc93826d1f96a0.tar.gz
sonarqube-dfb53e555565a7fbde113db0cccc93826d1f96a0.zip
Fix violations reported on Nemo
Diffstat (limited to 'plugins/sonar-findbugs-plugin')
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsCategory.java4
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java3
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java2
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsProfileImporter.java2
-rw-r--r--plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java25
5 files changed, 20 insertions, 16 deletions
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsCategory.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsCategory.java
index 2150dffc565..279f3114108 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsCategory.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsCategory.java
@@ -37,8 +37,10 @@ public final class FindbugsCategory {
findbugsToSonar.put("STYLE", "Style");
}
-
public static String findbugsToSonar(String findbugsCategKey) {
return findbugsToSonar.get(findbugsCategKey);
}
+
+ private FindbugsCategory() {
+ }
} \ No newline at end of file
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java
index d9dd6c4cb5f..d4b8b70dd66 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java
@@ -33,4 +33,7 @@ public final class FindbugsConstants {
*/
public static final String GENERATE_XML_KEY = "sonar.findbugs.generateXml";
public static final boolean GENERATE_XML_DEFAULT_VALUE = true; // TODO should be false - see SONAR-1880
+
+ private FindbugsConstants() {
+ }
}
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java
index e002572b295..84f9b8ef76c 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java
@@ -48,7 +48,7 @@ import edu.umd.cs.findbugs.config.UserPreferences;
*/
public class FindbugsExecutor implements BatchExtension {
- private static Logger LOG = LoggerFactory.getLogger(FindbugsExecutor.class);
+ private static final Logger LOG = LoggerFactory.getLogger(FindbugsExecutor.class);
private FindbugsConfiguration configuration;
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsProfileImporter.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsProfileImporter.java
index 39b32b6dd49..cef9c2ded00 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsProfileImporter.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsProfileImporter.java
@@ -40,7 +40,7 @@ import com.thoughtworks.xstream.XStream;
public class FindbugsProfileImporter extends ProfileImporter {
private final RuleFinder ruleFinder;
- private static Logger LOG = LoggerFactory.getLogger(FindbugsProfileImporter.class);
+ private static final Logger LOG = LoggerFactory.getLogger(FindbugsProfileImporter.class);
public FindbugsProfileImporter(RuleFinder ruleFinder) {
super(FindbugsConstants.REPOSITORY_KEY, FindbugsConstants.PLUGIN_NAME);
diff --git a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
index 31d721deca1..397502c995f 100644
--- a/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
+++ b/plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/xml/FindBugsFilter.java
@@ -19,21 +19,19 @@
*/
package org.sonar.plugins.findbugs.xml;
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.CharEncoding;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.rules.ActiveRule;
import org.sonar.api.rules.RulePriority;
-import org.sonar.api.rules.RulePriorityMapper;
import org.sonar.plugins.findbugs.FindbugsLevelUtils;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.annotations.XStreamAlias;
+import com.thoughtworks.xstream.annotations.XStreamImplicit;
@XStreamAlias("FindBugsFilter")
public class FindBugsFilter {
@@ -128,14 +126,15 @@ public class FindBugsFilter {
return result;
}
- private void completeLevels(Map<String, RulePriority> result, List<Bug> bugs, Priority priority, FindbugsLevelUtils priorityMapper, BugInfoSplitter splitter) {
+ private void completeLevels(Map<String, RulePriority> result, List<Bug> bugs, Priority priority, FindbugsLevelUtils priorityMapper,
+ BugInfoSplitter splitter) {
if (bugs == null) {
return;
}
RulePriority rulePriority = getRulePriority(priority, priorityMapper);
for (Bug bug : bugs) {
String varToSplit = splitter.getVar(bug);
- if (!StringUtils.isBlank(varToSplit)) {
+ if ( !StringUtils.isBlank(varToSplit)) {
String[] splitted = StringUtils.split(varToSplit, splitter.getSeparator());
for (String code : splitted) {
mapRulePriority(result, rulePriority, code);