aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-03 16:39:22 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-07 10:40:25 +0200
commit83418fb71df9db77e4b47c519524b995144bdf2b (patch)
treeabeb9532e6cd27578f601fc3815e99c9e4f9f22e
parentfd0d17f3c68b342ba37c5875d200bf28d476432e (diff)
downloadsonarqube-83418fb71df9db77e4b47c519524b995144bdf2b.tar.gz
sonarqube-83418fb71df9db77e4b47c519524b995144bdf2b.zip
Replace component ref by component key in error message.
Component ref doesn't help to know on which component there's an error
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureRepositoryImpl.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureRepositoryImpl.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureRepositoryImpl.java
index 24e22c3e68c..4a180c4655b 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureRepositoryImpl.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureRepositoryImpl.java
@@ -28,15 +28,15 @@ import java.util.Map;
import java.util.Set;
import javax.annotation.Nullable;
import org.sonar.batch.protocol.output.BatchReport;
-import org.sonar.db.measure.MeasureDto;
+import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
+import org.sonar.db.measure.MeasureDto;
import org.sonar.db.rule.RuleDto;
import org.sonar.server.computation.batch.BatchReportReader;
import org.sonar.server.computation.component.Component;
import org.sonar.server.computation.debt.Characteristic;
import org.sonar.server.computation.metric.Metric;
import org.sonar.server.computation.metric.MetricRepository;
-import org.sonar.db.DbClient;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
@@ -115,8 +115,8 @@ public class MeasureRepositoryImpl implements MeasureRepository {
if (existingMeasure.isPresent()) {
throw new UnsupportedOperationException(
format(
- "a measure can be set only once for a specific Component (ref=%s), Metric (key=%s)%s. Use update method",
- component.getRef(),
+ "a measure can be set only once for a specific Component (key=%s), Metric (key=%s)%s. Use update method",
+ component.getKey(),
metric.getKey(),
buildRuleOrCharacteristicMsgPart(measure)
));
@@ -133,8 +133,8 @@ public class MeasureRepositoryImpl implements MeasureRepository {
if (!existingMeasure.isPresent()) {
throw new UnsupportedOperationException(
format(
- "a measure can be updated only if one already exists for a specific Component (ref=%s), Metric (key=%s)%s. Use add method",
- component.getRef(),
+ "a measure can be updated only if one already exists for a specific Component (key=%s), Metric (key=%s)%s. Use add method",
+ component.getKey(),
metric.getKey(),
buildRuleOrCharacteristicMsgPart(measure)
));