Import StandardCharsets.UTF_8 as static

Change-Id: I066770f2eddfa7e9c1a67e91544006d33062d6d0
This commit is contained in:
David Pursehouse
2015-10-19 14:59:46 +09:00
parent 7f6601429a
commit c5cc9ddd12
8 changed files with 23 additions and 22 deletions

View File

@@ -14,6 +14,8 @@
package com.google.gerrit.httpd.auth.oauth;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import com.google.common.collect.Iterables;
@@ -32,7 +34,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
@@ -183,7 +184,7 @@ class OAuthWebFilter implements Filter {
byte[] bin = HtmlDomUtil.toUTF8(doc);
res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
res.setContentType("text/html");
res.setCharacterEncoding(StandardCharsets.UTF_8.name());
res.setCharacterEncoding(UTF_8.name());
res.setContentLength(bin.length);
try (ServletOutputStream out = res.getOutputStream()) {
out.write(bin);