Import StandardCharsets.UTF_8 as static
Change-Id: I066770f2eddfa7e9c1a67e91544006d33062d6d0
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gerrit.server.config.SitePaths;
|
||||
@@ -27,7 +29,6 @@ import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.ProcessBuilder.Redirect;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
@@ -134,7 +135,7 @@ public abstract class PluginDaemonTest extends AbstractDaemonTest {
|
||||
Path buckFile = pluginSource.resolve("BUCK");
|
||||
byte[] bytes = Files.readAllBytes(buckFile);
|
||||
String buckContent =
|
||||
new String(bytes, StandardCharsets.UTF_8).replaceAll("\\s+", "");
|
||||
new String(bytes, UTF_8).replaceAll("\\s+", "");
|
||||
Matcher matcher =
|
||||
Pattern.compile("gerrit_plugin\\(name='(.*?)'").matcher(buckContent);
|
||||
if (matcher.find()) {
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import static com.google.gerrit.httpd.restapi.RestApiServlet.JSON_MAGIC;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class RestResponse extends HttpResponse {
|
||||
|
||||
@@ -30,9 +30,8 @@ public class RestResponse extends HttpResponse {
|
||||
@Override
|
||||
public Reader getReader() throws IllegalStateException, IOException {
|
||||
if (reader == null && response.getEntity() != null) {
|
||||
reader =
|
||||
new InputStreamReader(response.getEntity().getContent(),
|
||||
StandardCharsets.UTF_8);
|
||||
reader = new InputStreamReader(
|
||||
response.getEntity().getContent(), UTF_8);
|
||||
reader.skip(JSON_MAGIC.length);
|
||||
}
|
||||
return reader;
|
||||
|
||||
Reference in New Issue
Block a user