summaryrefslogtreecommitdiffstats
path: root/server
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 /server
parentecbaff37b60045b8ba4cbc127633fde73b2bb1cb (diff)
downloadsonarqube-712a36ad76cb5b76252168a06528cf8324b82938.tar.gz
sonarqube-712a36ad76cb5b76252168a06528cf8324b82938.zip
Fix some quality flaws
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java16
1 files changed, 7 insertions, 9 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);