aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2016-10-12 16:49:57 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2016-10-18 16:00:26 +0200
commit6bec40f7b12d952e8fb1a1d61b1b5978593be96b (patch)
tree64dd2f89230bfc17b538948f4139935fda7f54d4
parent9d674d7e4a2bea9e069643733157638e580d874e (diff)
downloadsonarqube-6bec40f7b12d952e8fb1a1d61b1b5978593be96b.tar.gz
sonarqube-6bec40f7b12d952e8fb1a1d61b1b5978593be96b.zip
SONAR-8281 Rename measure "Coverage by unit tests" -> " "Coverage by tests"
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/index/DefaultIndex.java2
-rw-r--r--sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java6
4 files changed, 5 insertions, 7 deletions
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 523e4de12f5..c3d868e6254 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -2364,7 +2364,7 @@ metric.conditions_to_cover.description=Conditions to cover
metric.conditions_to_cover.name=Conditions to Cover
metric.confirmed_issues.description=Confirmed issues
metric.confirmed_issues.name=Confirmed Issues
-metric.coverage.description=Coverage by unit tests
+metric.coverage.description=Coverage by tests
metric.coverage.name=Coverage
metric.coverage_line_hits_data.description=Coverage hits by line
metric.coverage_line_hits_data.name=Coverage Hits by Line
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
index 164386e9b58..7cd75d43f81 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java
@@ -527,7 +527,7 @@ public final class CoreMetrics {
public static final String COVERAGE_KEY = "coverage";
public static final Metric<Double> COVERAGE = new Metric.Builder(COVERAGE_KEY, "Coverage", Metric.ValueType.PERCENT)
- .setDescription("Coverage by unit tests")
+ .setDescription("Coverage by tests")
.setDirection(Metric.DIRECTION_BETTER)
.setQualitative(true)
.setDomain(DOMAIN_COVERAGE)
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/index/DefaultIndex.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/index/DefaultIndex.java
index 4cb9f5b48d8..cf929bc3271 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/index/DefaultIndex.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/index/DefaultIndex.java
@@ -161,7 +161,7 @@ public class DefaultIndex {
public Measure addMeasure(Resource resource, Measure measure) {
Bucket bucket = getBucket(resource);
if (bucket != null) {
- return sensorStorage.saveMeasure(resource, measure);
+ sensorStorage.saveMeasure(resource, measure);
}
return measure;
}
diff --git a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
index f50c95e41d2..1c2f90b686f 100644
--- a/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
+++ b/sonar-scanner-engine/src/main/java/org/sonar/scanner/sensor/DefaultSensorStorage.java
@@ -137,10 +137,10 @@ public class DefaultSensorStorage implements SensorStorage {
}
}
- public org.sonar.api.measures.Measure saveMeasure(Resource resource, org.sonar.api.measures.Measure measure) {
+ public void saveMeasure(Resource resource, org.sonar.api.measures.Measure measure) {
if (DEPRECATED_METRICS_KEYS.contains(measure.getMetricKey())) {
// Ignore deprecated metrics
- return null;
+ return;
}
org.sonar.api.batch.measure.Metric metric = metricFinder.findByKey(measure.getMetricKey());
if (metric == null) {
@@ -148,13 +148,11 @@ public class DefaultSensorStorage implements SensorStorage {
}
if (!measure.isFromCore() && INTERNAL_METRICS.contains(metric)) {
LOG.debug("Metric " + metric.key() + " is an internal metric computed by SonarQube. Provided value is ignored.");
- return measure;
}
if (measureCache.contains(resource, measure)) {
throw new SonarException("Can not add the same measure twice on " + resource + ": " + measure);
}
measureCache.put(resource, measure);
- return measure;
}
private void setValueAccordingToMetricType(Measure<?> measure, org.sonar.api.measures.Metric<?> m, org.sonar.api.measures.Measure measureToSave) {