Upgrade soy to 2019-07-14

Migrate IndexServlet's usage of the deprecated render() and
setExpectedContentKind(...) methods to renderHtml().

Similar migration in OutgoingEmail is done in a follow-up
commit.

Change-Id: I5a5ac6e0b6674b2d2aa9a1cf60fab400b036cea7
This commit is contained in:
David Pursehouse
2019-07-16 10:49:36 +09:00
parent 4c0e265d1c
commit 6b512390cf
2 changed files with 4 additions and 8 deletions

View File

@@ -752,8 +752,8 @@ maven_jar(
# Keep this version of Soy synchronized with the version used in Gitiles.
maven_jar(
name = "soy",
artifact = "com.google.template:soy:2019-04-18",
sha1 = "5750208855562d74f29eee39ee497d5cf6df1490",
artifact = "com.google.template:soy:2019-07-14",
sha1 = "547dee679bac6011126f3a54619d3aec336216d0",
)
maven_jar(

View File

@@ -74,11 +74,7 @@ public class IndexServlet extends HttpServlet {
ImmutableMap<String, Object> templateData =
IndexHtmlUtil.templateData(
gerritApi, canonicalUrl, cdnPath, faviconPath, parameterMap, urlOrdainer);
renderer =
soySauce
.renderTemplate("com.google.gerrit.httpd.raw.Index")
.setExpectedContentKind(SanitizedContent.ContentKind.HTML)
.setData(templateData);
renderer = soySauce.renderTemplate("com.google.gerrit.httpd.raw.Index").setData(templateData);
} catch (URISyntaxException | RestApiException e) {
throw new IOException(e);
}
@@ -87,7 +83,7 @@ public class IndexServlet extends HttpServlet {
rsp.setContentType("text/html");
rsp.setStatus(SC_OK);
try (OutputStream w = rsp.getOutputStream()) {
w.write(renderer.render().get().getBytes(UTF_8));
w.write(renderer.renderHtml().get().toString().getBytes(UTF_8));
}
}
}