aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-02-10 15:23:30 +0100
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>2015-02-11 16:43:24 +0100
commit6136a7a313d5253ee6443eff52d602bac022ad14 (patch)
tree37b9d87c39f56a75339fadc1b1b59d9e30fbefcd /plugins
parent4d8fbfb4f1be2d2333d1cb051626a29c9442cc6e (diff)
downloadsonarqube-6136a7a313d5253ee6443eff52d602bac022ad14.tar.gz
sonarqube-6136a7a313d5253ee6443eff52d602bac022ad14.zip
SONAR-5183 timezones - project_measures and manual_measures migrations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ManualMeasureDecorator.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ManualMeasureDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ManualMeasureDecorator.java
index ce54b9bf4dc..3825b13348f 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ManualMeasureDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/ManualMeasureDecorator.java
@@ -32,6 +32,8 @@ import org.sonar.jpa.entity.ManualMeasure;
import java.util.List;
+import static com.google.common.base.Preconditions.checkState;
+
@Phase(name = Phase.Name.PRE)
public class ManualMeasureDecorator implements Decorator {
@@ -60,9 +62,8 @@ public class ManualMeasureDecorator implements Decorator {
private Measure copy(ManualMeasure manualMeasure) {
Metric metric = metricFinder.findById(manualMeasure.getMetricId());
- if (metric == null) {
- throw new IllegalStateException("Unable to find manual metric with id: " + manualMeasure.getMetricId());
- }
+ checkState(metric != null, "Unable to find manual metric with id: " + manualMeasure.getMetricId());
+
Measure measure = new Measure(metric);
measure.setValue(manualMeasure.getValue(), 5);
measure.setData(manualMeasure.getTextValue());