diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-01 11:12:34 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-07-01 12:10:47 +0200 |
commit | 85445db60e417c23237e38715256449839efbb4b (patch) | |
tree | 45e2892b635892409d82c1a2a7938fb2322ecbc5 /sonar-batch | |
parent | d74be88c29c5b967278aab5202f0aff1184143a0 (diff) | |
download | sonarqube-85445db60e417c23237e38715256449839efbb4b.tar.gz sonarqube-85445db60e417c23237e38715256449839efbb4b.zip |
Fix some quality flaws
Diffstat (limited to 'sonar-batch')
-rw-r--r-- | sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java b/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java index ccda40c429b..d3e0677e86c 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java +++ b/sonar-batch/src/main/java/org/sonar/batch/scan/measure/MeasureValueCoder.java @@ -26,6 +26,8 @@ import org.sonar.api.measures.Measure; import org.sonar.api.measures.Metric; import org.sonar.api.measures.MetricFinder; import org.sonar.api.measures.PersistenceMode; +import org.sonar.api.technicaldebt.batch.Characteristic; +import org.sonar.api.technicaldebt.batch.Requirement; import org.sonar.api.technicaldebt.batch.TechnicalDebtModel; class MeasureValueCoder implements ValueCoder { @@ -54,10 +56,14 @@ class MeasureValueCoder implements ValueCoder { value.put(m.getVariation4()); value.put(m.getVariation5()); value.putString(m.getUrl()); - value.put(m.getCharacteristic() != null ? m.getCharacteristic().id() : null); - value.put(m.getRequirement() != null ? m.getRequirement().id() : null); - value.put(m.getPersonId() != null ? m.getPersonId().intValue() : null); - value.putString(m.getPersistenceMode() != null ? m.getPersistenceMode().name() : null); + Characteristic characteristic = m.getCharacteristic(); + value.put(characteristic != null ? characteristic.id() : null); + Requirement requirement = m.getRequirement(); + value.put(requirement != null ? requirement.id() : null); + Integer personId = m.getPersonId(); + value.put(personId != null ? personId.intValue() : null); + PersistenceMode persistenceMode = m.getPersistenceMode(); + value.putString(persistenceMode != null ? persistenceMode.name() : null); } public Object get(Value value, Class clazz, CoderContext context) { |