Skip to content

Commit

Permalink
Fix quality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dbmeneses committed May 5, 2017
1 parent 6945920 commit b49a85f
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -31,8 +31,8 @@

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.
Expand Down Expand Up @@ -81,8 +81,8 @@ public Result isUTF16(byte[] buffer, boolean failOnNull) {
}
}

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
Expand Down

0 comments on commit b49a85f

Please sign in to comment.