Error Prone: Enable and fix DefaultCharset
Change-Id: Ia2fbb143d47031f0692854505e99f1be63cb0408
This commit is contained in:
committed by
David Pursehouse
parent
ae99a1b7c3
commit
960157256f
@@ -19,6 +19,7 @@ import static com.google.gerrit.acceptance.rest.project.ProjectAssert.assertThat
|
||||
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.block;
|
||||
import static com.google.gerrit.server.group.SystemGroupBackend.REGISTERED_USERS;
|
||||
import static com.google.gerrit.testing.GerritJUnit.assertThrows;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
@@ -149,7 +150,9 @@ public class ListProjectsIT extends AbstractDaemonTest {
|
||||
listProjects.displayToStream(displayOut);
|
||||
|
||||
List<String> lines =
|
||||
Splitter.on("\n").omitEmptyStrings().splitToList(new String(displayOut.toByteArray()));
|
||||
Splitter.on("\n")
|
||||
.omitEmptyStrings()
|
||||
.splitToList(new String(displayOut.toByteArray(), UTF_8));
|
||||
assertThat(lines).isEqualTo(testProjects);
|
||||
}
|
||||
}
|
||||
@@ -178,7 +181,7 @@ public class ListProjectsIT extends AbstractDaemonTest {
|
||||
listProjects.setFormat(jsonFormat);
|
||||
listProjects.displayToStream(displayOut);
|
||||
|
||||
String projectsJsonOutput = new String(displayOut.toByteArray());
|
||||
String projectsJsonOutput = new String(displayOut.toByteArray(), UTF_8);
|
||||
|
||||
Gson gson = jsonFormat.newGson();
|
||||
Set<String> projectsJsonNames = gson.fromJson(projectsJsonOutput, JsonObject.class).keySet();
|
||||
|
||||
@@ -46,6 +46,7 @@ java_package_configuration(
|
||||
"-Xep:CannotMockFinalClass:ERROR",
|
||||
"-Xep:ClassCanBeStatic:ERROR",
|
||||
"-Xep:ClassNewInstance:ERROR",
|
||||
"-Xep:DefaultCharset:ERROR",
|
||||
"-Xep:DoubleCheckedLocking:ERROR",
|
||||
"-Xep:ElementsCountedInLoop:ERROR",
|
||||
"-Xep:StringEquality:ERROR",
|
||||
|
||||
Reference in New Issue
Block a user