aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-05-11 17:23:12 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2015-05-11 17:23:12 +0200
commit712a36ad76cb5b76252168a06528cf8324b82938 (patch)
tree2de174b7107de5124f7b73dc7de607faf30eb4c5
parentecbaff37b60045b8ba4cbc127633fde73b2bb1cb (diff)
downloadsonarqube-712a36ad76cb5b76252168a06528cf8324b82938.tar.gz
sonarqube-712a36ad76cb5b76252168a06528cf8324b82938.zip
Fix some quality flaws
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java16
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java5
2 files changed, 8 insertions, 13 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
index 69021c46766..920ca9e3ccc 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
@@ -19,14 +19,12 @@
*/
package org.sonar.server.debt;
-import org.sonar.api.ServerSide;
-
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.ObjectUtils;
-import org.sonar.api.ServerComponent;
+import org.sonar.api.ServerSide;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.server.debt.DebtCharacteristic;
import org.sonar.api.server.debt.DebtRemediationFunction;
@@ -74,16 +72,16 @@ public class DebtModelBackup {
private final System2 system2;
public DebtModelBackup(DbClient dbClient, DebtModelOperations debtModelOperations, RuleOperations ruleOperations,
- DebtModelPluginRepository debtModelPluginRepository, DebtCharacteristicsXMLImporter characteristicsXMLImporter, DebtRulesXMLImporter rulesXMLImporter,
- DebtModelXMLExporter debtModelXMLExporter, RuleDefinitionsLoader defLoader) {
+ DebtModelPluginRepository debtModelPluginRepository, DebtCharacteristicsXMLImporter characteristicsXMLImporter, DebtRulesXMLImporter rulesXMLImporter,
+ DebtModelXMLExporter debtModelXMLExporter, RuleDefinitionsLoader defLoader) {
this(dbClient, debtModelOperations, ruleOperations, debtModelPluginRepository, characteristicsXMLImporter, rulesXMLImporter, debtModelXMLExporter,
defLoader, System2.INSTANCE);
}
@VisibleForTesting
DebtModelBackup(DbClient dbClient, DebtModelOperations debtModelOperations, RuleOperations ruleOperations,
- DebtModelPluginRepository debtModelPluginRepository, DebtCharacteristicsXMLImporter characteristicsXMLImporter, DebtRulesXMLImporter rulesXMLImporter,
- DebtModelXMLExporter debtModelXMLExporter, RuleDefinitionsLoader defLoader, System2 system2) {
+ DebtModelPluginRepository debtModelPluginRepository, DebtCharacteristicsXMLImporter characteristicsXMLImporter, DebtRulesXMLImporter rulesXMLImporter,
+ DebtModelXMLExporter debtModelXMLExporter, RuleDefinitionsLoader defLoader, System2 system2) {
this.dbClient = dbClient;
this.debtModelOperations = debtModelOperations;
this.ruleOperations = ruleOperations;
@@ -235,7 +233,7 @@ public class DebtModelBackup {
}
private void restoreRules(List<CharacteristicDto> allCharacteristicDtos, List<RuleDto> rules, List<RuleDebt> ruleDebts,
- ValidationMessages validationMessages, Date updateDate, DbSession session) {
+ ValidationMessages validationMessages, Date updateDate, DbSession session) {
for (RuleDto rule : rules) {
RuleDebt ruleDebt = ruleDebt(rule.getRepositoryKey(), rule.getRuleKey(), ruleDebts);
String subCharacteristicKey = ruleDebt != null ? ruleDebt.subCharacteristicKey() : null;
@@ -277,7 +275,7 @@ public class DebtModelBackup {
}
private CharacteristicDto restoreCharacteristic(DebtCharacteristic targetCharacteristic, @Nullable Integer parentId, List<CharacteristicDto> sourceCharacteristics,
- Date updateDate, DbSession session) {
+ Date updateDate, DbSession session) {
CharacteristicDto sourceCharacteristic = characteristicByKey(targetCharacteristic.key(), sourceCharacteristics, false);
if (sourceCharacteristic == null) {
CharacteristicDto newCharacteristic = toDto(targetCharacteristic, parentId).setCreatedAt(updateDate);
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
index 8284eb884c2..50c08020c06 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/scan/ModuleScanContainer.java
@@ -26,12 +26,10 @@ import org.sonar.api.batch.bootstrap.ProjectDefinition;
import org.sonar.api.batch.fs.internal.FileMetadata;
import org.sonar.api.batch.rule.CheckFactory;
import org.sonar.api.checks.NoSonarFilter;
-import org.sonar.core.platform.ComponentContainer;
import org.sonar.api.resources.Project;
import org.sonar.api.scan.filesystem.FileExclusions;
import org.sonar.batch.DefaultProjectTree;
import org.sonar.batch.bootstrap.BatchExtensionDictionnary;
-import org.sonar.batch.bootstrap.DefaultAnalysisMode;
import org.sonar.batch.bootstrap.ExtensionInstaller;
import org.sonar.batch.bootstrap.ExtensionMatcher;
import org.sonar.batch.bootstrap.ExtensionUtils;
@@ -84,17 +82,16 @@ import org.sonar.batch.sensor.SensorOptimizer;
import org.sonar.batch.sensor.coverage.CoverageExclusions;
import org.sonar.batch.source.HighlightableBuilder;
import org.sonar.batch.source.SymbolizableBuilder;
+import org.sonar.core.platform.ComponentContainer;
import org.sonar.core.timemachine.Periods;
public class ModuleScanContainer extends ComponentContainer {
private static final Logger LOG = LoggerFactory.getLogger(ModuleScanContainer.class);
private final Project module;
- private DefaultAnalysisMode analysisMode;
public ModuleScanContainer(ProjectScanContainer parent, Project module) {
super(parent);
this.module = module;
- analysisMode = parent.getComponentByType(DefaultAnalysisMode.class);
}
@Override