From: Julien Lancelot Date: Thu, 12 Dec 2013 12:21:48 +0000 (+0100) Subject: Fix quality flaws X-Git-Tag: 4.2~998 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cddc30bfdddf32e8de4456ce050310d10362f8e6;p=sonarqube.git Fix quality flaws --- diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/report/JsonReport.java b/sonar-batch/src/main/java/org/sonar/batch/scan/report/JsonReport.java index 992fb82ae91..cca87185e97 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/report/JsonReport.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/report/JsonReport.java @@ -40,16 +40,10 @@ import org.sonar.batch.bootstrap.AnalysisMode; import org.sonar.batch.events.BatchStepEvent; import org.sonar.batch.events.EventBus; import org.sonar.batch.issue.IssueCache; -import org.sonar.core.i18n.RuleI18nManager; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.Writer; +import java.io.*; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import java.util.Set; import static com.google.common.collect.Sets.newHashSet; @@ -72,13 +66,13 @@ public class JsonReport implements BatchComponent { private UserFinder userFinder; public JsonReport(Settings settings, ModuleFileSystem fileSystem, Server server, RuleFinder ruleFinder, IssueCache issueCache, - EventBus eventBus, ComponentSelectorFactory componentSelectorFactory, AnalysisMode mode, UserFinder userFinder) { + EventBus eventBus, ComponentSelectorFactory componentSelectorFactory, AnalysisMode mode, UserFinder userFinder) { this(settings, fileSystem, server, ruleFinder, issueCache, eventBus, componentSelectorFactory.create(), mode, userFinder); } @VisibleForTesting JsonReport(Settings settings, ModuleFileSystem fileSystem, Server server, RuleFinder ruleFinder, IssueCache issueCache, - EventBus eventBus, ComponentSelector componentSelector, AnalysisMode analysisMode, UserFinder userFinder) { + EventBus eventBus, ComponentSelector componentSelector, AnalysisMode analysisMode, UserFinder userFinder) { this.settings = settings; this.fileSystem = fileSystem; this.server = server; diff --git a/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java b/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java index 639225b7124..59756fa892a 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/RubyRuleService.java @@ -23,11 +23,8 @@ import com.google.common.collect.Maps; import org.apache.commons.lang.StringUtils; import org.picocontainer.Startable; import org.sonar.api.ServerComponent; -import org.sonar.api.rules.Rule; import org.sonar.core.i18n.RuleI18nManager; -import javax.annotation.CheckForNull; - import java.util.Map; /** @@ -60,7 +57,7 @@ public class RubyRuleService implements ServerComponent, Startable { } private static void translateNonBlankKey(Map options, Map params, String optionKey, String paramKey) { - if(options.get(optionKey) != null && StringUtils.isNotBlank(options.get(optionKey).toString())) { + if (options.get(optionKey) != null && StringUtils.isNotBlank(options.get(optionKey).toString())) { params.put(paramKey, options.get(optionKey).toString()); } }