aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-12-14 09:41:43 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-12-14 09:41:43 +0100
commit1480dd77272d6531aa383e2a1a983bf1259a213e (patch)
treed9347f242c325d43fda6cf945c9ea9cbcfe156e6 /sonar-plugin-api
parentc637a52e84db7cc86c1ef574ac6fa2787d2a0683 (diff)
downloadsonarqube-1480dd77272d6531aa383e2a1a983bf1259a213e.tar.gz
sonarqube-1480dd77272d6531aa383e2a1a983bf1259a213e.zip
SONAR-6939 decrease maximum nb of decimal digits to 5
More than 5 breaks the support of big numbers
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java4
2 files changed, 3 insertions, 3 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
index 8fdb94f44a6..4783b6e178e 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Metric.java
@@ -51,7 +51,7 @@ public class Metric<G extends Serializable> implements Serializable, org.sonar.a
* The maximum supported value of scale for decimal metrics
* @since 5.3
*/
- public static final int MAX_DECIMAL_SCALE = 20;
+ public static final int MAX_DECIMAL_SCALE = 5;
/**
* A metric bigger value means a degradation
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
index 0a088f53d3a..e5765d51961 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/measures/MetricTest.java
@@ -84,10 +84,10 @@ public class MetricTest {
@Test
public void fail_if_decimal_scale_is_greater_than_max_supported_value() {
expectedException.expect(IllegalArgumentException.class);
- expectedException.expectMessage("Scale of decimal metric [foo] must be less than or equal 20: 21");
+ expectedException.expectMessage("Scale of decimal metric [foo] must be less than or equal 5: 6");
new Metric.Builder("foo", "Foo", Metric.ValueType.FLOAT)
- .setDecimalScale(Metric.MAX_DECIMAL_SCALE + 1)
+ .setDecimalScale(6)
.create();
}