Specify charset in constructors of InputStreamReader

ErrorProne reports a warning [1] about implicit use of the platform
default charset.

[1] http://errorprone.info/bugpattern/DefaultCharset

Change-Id: Id661781773ca175b52a17cf4d80c37fad17344a8
This commit is contained in:
David Pursehouse
2018-08-31 10:15:26 +09:00
parent 9932a88865
commit ce98c50f38
3 changed files with 6 additions and 3 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.server.mail.send;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assert_;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.io.BufferedReader;
import java.io.InputStream;
@@ -36,7 +37,7 @@ public class ValidatorTest {
if (in == null) {
throw new Exception("TLD list not found");
}
BufferedReader r = new BufferedReader(new InputStreamReader(in));
BufferedReader r = new BufferedReader(new InputStreamReader(in, UTF_8));
String tld;
while ((tld = r.readLine()) != null) {
if (tld.startsWith("# ") || tld.startsWith("XN--")) {