diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2020-12-08 16:19:22 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-09 20:07:21 +0000 |
commit | 296343a51973cf51be21c66964aad2dce7fe7f1e (patch) | |
tree | 0677ae66ce919e8dda47f554d1775d1707ab9e59 /server/sonar-webserver-webapi/src | |
parent | 99afeb0ec5899418eec90c2370230d03855b86c1 (diff) | |
download | sonarqube-296343a51973cf51be21c66964aad2dce7fe7f1e.tar.gz sonarqube-296343a51973cf51be21c66964aad2dce7fe7f1e.zip |
fix floating point equality
Diffstat (limited to 'server/sonar-webserver-webapi/src')
-rw-r--r-- | server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/custom/ws/CustomMeasureJsonWriter.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/custom/ws/CustomMeasureJsonWriter.java b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/custom/ws/CustomMeasureJsonWriter.java index 7f3635d4b45..dc71e211e5f 100644 --- a/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/custom/ws/CustomMeasureJsonWriter.java +++ b/server/sonar-webserver-webapi/src/main/java/org/sonar/server/measure/custom/ws/CustomMeasureJsonWriter.java @@ -88,7 +88,7 @@ public class CustomMeasureJsonWriter { switch (metricType) { case BOOL: - return doubleValue == 1.0d ? "true" : "false"; + return Double.compare(doubleValue, 1.0D) == 0 ? "true" : "false"; case INT: case MILLISEC: return String.valueOf((int) doubleValue); |