]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality issues
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Thu, 4 May 2017 08:42:41 +0000 (10:42 +0200)
committerdbmeneses <duarte.meneses@sonarsource.com>
Fri, 5 May 2017 11:44:12 +0000 (12:44 +0100)
sonar-scanner-engine/src/main/java/org/sonar/scanner/scan/filesystem/CharsetValidation.java

index 8dd8f44240d3e85664ab6527eb480fac8ddaa841..5125a801a4e2ff66a41f6c4270457830e7aa7f88 100644 (file)
@@ -31,8 +31,8 @@ import javax.annotation.Nullable;
 
 public class CharsetValidation {
 
-  private static final float UTF_16_NULL_PASS_THRESHOLD = 0.7f;
-  private static final float UTF_16_NULL_FAIL_THRESHOLD = 0.1f;
+  private static final double UTF_16_NULL_PASS_THRESHOLD = 0.7;
+  private static final double UTF_16_NULL_FAIL_THRESHOLD = 0.1;
 
   /**
    * Checks if an array of bytes looks UTF-16 encoded. 
@@ -81,8 +81,8 @@ public class CharsetValidation {
       }
     }
 
-    float beAsciiPerc = beAscii * 2.0f / (float) buffer.length;
-    float leAsciiPerc = leAscii * 2.0f / (float) buffer.length;
+    double beAsciiPerc = beAscii * 2.0 / (double) buffer.length;
+    double leAsciiPerc = leAscii * 2.0 / (double) buffer.length;
 
     if (leLines == 0) {
       // could be BE