aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-25 16:57:03 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-26 11:51:06 +0100
commitb4fcf5538abbc74d0dd87760fd6687454d4bda84 (patch)
tree732c0f91a4a230fdffed35648f62694ff2437bac
parente4fbc18ffc109d870c863355419eda9be4afd529 (diff)
downloadsonarqube-b4fcf5538abbc74d0dd87760fd6687454d4bda84.tar.gz
sonarqube-b4fcf5538abbc74d0dd87760fd6687454d4bda84.zip
SONAR-5056 Minor refactoring
-rw-r--r--sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java3
-rw-r--r--sonar-server/src/main/java/org/sonar/server/debt/DebtModelXMLExporter.java3
2 files changed, 2 insertions, 4 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
index b66e8bceb33..7c6ae137ce2 100644
--- a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
+++ b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelBackup.java
@@ -238,7 +238,7 @@ public class DebtModelBackup implements ServerComponent {
List<CharacteristicDto> result = newArrayList();
- // Restore not existing characteristics
+ // Create new characteristics
for (DebtCharacteristic characteristic : targetModel.rootCharacteristics()) {
CharacteristicDto rootCharacteristicDto = restoreCharacteristic(characteristic, null, sourceCharacteristics, updateDate, session);
result.add(rootCharacteristicDto);
@@ -366,5 +366,4 @@ public class DebtModelBackup implements ServerComponent {
UserSession.get().checkGlobalPermission(GlobalPermissions.SYSTEM_ADMIN);
}
-
}
diff --git a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelXMLExporter.java b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelXMLExporter.java
index 37cb409e411..e837598ebb7 100644
--- a/sonar-server/src/main/java/org/sonar/server/debt/DebtModelXMLExporter.java
+++ b/sonar-server/src/main/java/org/sonar/server/debt/DebtModelXMLExporter.java
@@ -228,14 +228,13 @@ public class DebtModelXMLExporter implements ServerComponent {
}, null);
}
- @CheckForNull
public DebtCharacteristic characteristicById(final Integer id) {
return Iterables.find(characteristicsByRootKey.values(), new Predicate<DebtCharacteristic>() {
@Override
public boolean apply(DebtCharacteristic input) {
return id.equals(input.id());
}
- }, null);
+ });
}
private List<DebtCharacteristic> sortByOrder(List<DebtCharacteristic> characteristics) {