aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-12 08:25:20 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-03-12 08:25:20 +0100
commit659ff60252fcf0ca4f34bb69010be0043ef1c675 (patch)
tree5f57a5626d8c2c0fe4ba835f83bb9145b455de08 /sonar-batch
parent260814641dc770baefbe787da616cfff9d16eb87 (diff)
downloadsonarqube-659ff60252fcf0ca4f34bb69010be0043ef1c675.tar.gz
sonarqube-659ff60252fcf0ca4f34bb69010be0043ef1c675.zip
SONAR-5056 Removed some useless usage of Requirement
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
index 25b0cb369e3..564ee82ec72 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/MeasurePersister.java
@@ -35,7 +35,6 @@ import org.sonar.api.resources.ResourceUtils;
import org.sonar.api.rules.Rule;
import org.sonar.api.rules.RuleFinder;
import org.sonar.api.technicaldebt.batch.Characteristic;
-import org.sonar.api.technicaldebt.batch.Requirement;
import org.sonar.api.utils.SonarException;
import org.sonar.core.persistence.MyBatis;
@@ -112,9 +111,9 @@ public final class MeasurePersister {
!(ResourceUtils.isEntity(resource) && measure.isBestValue()) && isMeasureNotEmpty(measure);
}
- private static boolean isMeasureNotEmpty(Measure measure){
+ private static boolean isMeasureNotEmpty(Measure measure) {
boolean isNotEmpty = false;
- for (int i = 1; i<=5; i++) {
+ for (int i = 1; i <= 5; i++) {
isNotEmpty = isNotEmpty || measure.getVariation(i) != null;
}
return measure.getValue() != null || measure.getData() != null
@@ -155,16 +154,13 @@ public final class MeasurePersister {
model.setVariationValue5(measure.getVariation5());
model.setUrl(measure.getUrl());
Characteristic characteristic = measure.getCharacteristic();
- Requirement requirement = measure.getRequirement();
if (characteristic != null) {
model.setCharacteristicId(characteristic.id());
- } else if (requirement != null) {
- model.setCharacteristicId(requirement.id());
}
model.setPersonId(measure.getPersonId());
Double value = measure.getValue();
if (value != null) {
- model.setValue(value.doubleValue());
+ model.setValue(value);
} else {
model.setValue(null);
}