Format Java files with google-java-format
Change-Id: Id0cce149584fa4887eaaf4ecfc22da29a9daecfd
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/IndexServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/IndexServlet.java
index d7f7a8a..bf1339f 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/IndexServlet.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/IndexServlet.java
@@ -22,8 +22,8 @@
import com.google.template.soy.SoyFileSet;
import com.google.template.soy.data.SanitizedContent;
import com.google.template.soy.data.SoyMapData;
-import com.google.template.soy.tofu.SoyTofu;
import com.google.template.soy.data.UnsafeSanitizedContentOrdainer;
+import com.google.template.soy.tofu.SoyTofu;
import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
@@ -39,10 +39,13 @@
String resourcePath = "com/google/gerrit/httpd/raw/index.html.soy";
SoyFileSet.Builder builder = SoyFileSet.builder();
builder.add(Resources.getResource(resourcePath));
- SoyTofu.Renderer renderer = builder.build().compileToTofu()
- .newRenderer("com.google.gerrit.httpd.raw.Index")
- .setContentKind(SanitizedContent.ContentKind.HTML)
- .setData(getTemplateData(canonicalURL, cdnPath));
+ SoyTofu.Renderer renderer =
+ builder
+ .build()
+ .compileToTofu()
+ .newRenderer("com.google.gerrit.httpd.raw.Index")
+ .setContentKind(SanitizedContent.ContentKind.HTML)
+ .setData(getTemplateData(canonicalURL, cdnPath));
indexSource = renderer.render().getBytes();
}
@@ -75,8 +78,9 @@
// The resource path must be typed as safe for use in a script src.
// TODO(wyatta): Upgrade this to use an appropriate safe URL type.
- SanitizedContent sanitizedStaticPath = UnsafeSanitizedContentOrdainer.ordainAsSafe(staticPath,
- SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI);
+ SanitizedContent sanitizedStaticPath =
+ UnsafeSanitizedContentOrdainer.ordainAsSafe(
+ staticPath, SanitizedContent.ContentKind.TRUSTED_RESOURCE_URI);
return new SoyMapData(
"canonicalPath", canonicalPath,
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java
index 6e055a9..d0d905d 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/StaticModule.java
@@ -33,7 +33,6 @@
import com.google.gerrit.server.config.SitePaths;
import com.google.inject.Inject;
import com.google.inject.Key;
-import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.ProvisionException;
import com.google.inject.Singleton;
@@ -252,8 +251,9 @@
@Provides
@Singleton
@Named(POLYGERRIT_INDEX_SERVLET)
- HttpServlet getPolyGerritUiIndexServlet(@CanonicalWebUrl @Nullable String canonicalUrl,
- @GerritServerConfig Config cfg) throws URISyntaxException {
+ HttpServlet getPolyGerritUiIndexServlet(
+ @CanonicalWebUrl @Nullable String canonicalUrl, @GerritServerConfig Config cfg)
+ throws URISyntaxException {
String cdnPath = cfg.getString("gerrit", null, "cdnPath");
return new IndexServlet(canonicalUrl, cdnPath);
}
diff --git a/gerrit-httpd/src/test/java/com/google/gerrit/httpd/raw/IndexServletTest.java b/gerrit-httpd/src/test/java/com/google/gerrit/httpd/raw/IndexServletTest.java
index ffdbc0b..7133cf6 100644
--- a/gerrit-httpd/src/test/java/com/google/gerrit/httpd/raw/IndexServletTest.java
+++ b/gerrit-httpd/src/test/java/com/google/gerrit/httpd/raw/IndexServletTest.java
@@ -14,13 +14,12 @@
package com.google.gerrit.httpd.raw;
-import com.google.gerrit.common.Nullable;
+import static com.google.common.truth.Truth.assertThat;
+
import com.google.template.soy.data.SoyMapData;
import java.net.URISyntaxException;
import org.junit.Test;
-import static com.google.common.truth.Truth.assertThat;
-
public class IndexServletTest {
@Test
public void noPathAndNoCDN() throws URISyntaxException {
@@ -38,8 +37,8 @@
@Test
public void noPathAndCDN() throws URISyntaxException {
- SoyMapData data = IndexServlet.getTemplateData("http://example.com/",
- "http://my-cdn.com/foo/bar/");
+ SoyMapData data =
+ IndexServlet.getTemplateData("http://example.com/", "http://my-cdn.com/foo/bar/");
assertThat(data.getSingle("canonicalPath").stringValue()).isEqualTo("");
assertThat(data.getSingle("staticResourcePath").stringValue())
.isEqualTo("http://my-cdn.com/foo/bar/");
@@ -47,8 +46,8 @@
@Test
public void pathAndCDN() throws URISyntaxException {
- SoyMapData data = IndexServlet.getTemplateData("http://example.com/gerrit",
- "http://my-cdn.com/foo/bar/");
+ SoyMapData data =
+ IndexServlet.getTemplateData("http://example.com/gerrit", "http://my-cdn.com/foo/bar/");
assertThat(data.getSingle("canonicalPath").stringValue()).isEqualTo("/gerrit");
assertThat(data.getSingle("staticResourcePath").stringValue())
.isEqualTo("http://my-cdn.com/foo/bar/");