diff options
author | Godin <mandrikov@gmail.com> | 2010-11-25 18:10:45 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-11-25 18:10:45 +0000 |
commit | dfb53e555565a7fbde113db0cccc93826d1f96a0 (patch) | |
tree | 1506351f591204d104b4dda5f5d541152a83ca7a /plugins/sonar-findbugs-plugin | |
parent | 8e4f854d97a1c60ee20b32f5611627d0a924402a (diff) | |
download | sonarqube-dfb53e555565a7fbde113db0cccc93826d1f96a0.tar.gz sonarqube-dfb53e555565a7fbde113db0cccc93826d1f96a0.zip |
Fix violations reported on Nemo
Diffstat (limited to 'plugins/sonar-findbugs-plugin')
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); |