Format sources using google-java-format 1.24.0
Gerrit updated to this version in [1].
[1] https://gerrit-review.googlesource.com/c/gerrit/+/441049
Change-Id: I81441a8b179d13edb539346689370868c2491e02
diff --git a/java/com/google/gitiles/GitilesView.java b/java/com/google/gitiles/GitilesView.java
index f5be973..4b22e8d 100644
--- a/java/com/google/gitiles/GitilesView.java
+++ b/java/com/google/gitiles/GitilesView.java
@@ -114,7 +114,7 @@
case LOG:
case DIFF:
oldRevision = other.oldRevision;
- // $FALL-THROUGH$
+ // $FALL-THROUGH$
case PATH:
case DOC:
case ROOTED_DOC:
@@ -122,15 +122,15 @@
case BLAME:
case SHOW:
path = other.path;
- // $FALL-THROUGH$
+ // $FALL-THROUGH$
case REVISION:
revision = other.revision;
- // $FALL-THROUGH$
+ // $FALL-THROUGH$
case DESCRIBE:
case REFS:
case REPOSITORY_INDEX:
repositoryName = other.repositoryName;
- // $FALL-THROUGH$
+ // $FALL-THROUGH$
default:
break;
}
diff --git a/java/com/google/gitiles/PathServlet.java b/java/com/google/gitiles/PathServlet.java
index fc0af05..b2563b0 100644
--- a/java/com/google/gitiles/PathServlet.java
+++ b/java/com/google/gitiles/PathServlet.java
@@ -52,8 +52,6 @@
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.ObjectReader;
-import org.eclipse.jgit.lib.Ref;
-import org.eclipse.jgit.lib.RefDatabase;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevObject;
@@ -318,7 +316,9 @@
}
private static class AutoDiveFilter extends TreeFilter {
- /** @see GitilesView#getBreadcrumbs(List) */
+ /**
+ * @see GitilesView#getBreadcrumbs(List)
+ */
List<Boolean> hasSingleTree;
private final byte[] pathRaw;
@@ -540,34 +540,34 @@
return p.eof() ? p : null;
}
- private @Nullable URI createEditUrl(HttpServletRequest req, GitilesView view)
- throws IOException {
- String baseGerritUrl = this.urls.getBaseGerritUrl(req);
- if (baseGerritUrl == null) {
- return null;
- }
- String commitish = view.getRevision().getName();
- if (commitish == null || !commitish.startsWith("refs/heads/")) {
- return null;
- }
- try {
- URI editUrl = new URI(baseGerritUrl);
- String path =
- String.format("/admin/repos/edit/repo/%s/branch/%s/file/%s",
- view.getRepositoryName(),
- commitish,
- view.getPathPart());
- return editUrl.resolve(escapeName(path));
- } catch (URISyntaxException use) {
- log.warn("Malformed Edit URL", use);
- }
+ private @Nullable URI createEditUrl(HttpServletRequest req, GitilesView view) throws IOException {
+ String baseGerritUrl = this.urls.getBaseGerritUrl(req);
+ if (baseGerritUrl == null) {
return null;
+ }
+ String commitish = view.getRevision().getName();
+ if (commitish == null || !commitish.startsWith("refs/heads/")) {
+ return null;
+ }
+ try {
+ URI editUrl = new URI(baseGerritUrl);
+ String path =
+ String.format(
+ "/admin/repos/edit/repo/%s/branch/%s/file/%s",
+ view.getRepositoryName(), commitish, view.getPathPart());
+ return editUrl.resolve(escapeName(path));
+ } catch (URISyntaxException use) {
+ log.warn("Malformed Edit URL", use);
+ }
+ return null;
}
private void showFile(HttpServletRequest req, HttpServletResponse res, WalkResult wr)
throws IOException {
GitilesView view = ViewFilter.getView(req);
- Map<String, ?> data = new BlobSoyData(wr.getObjectReader(), view).toSoyData(wr.path, wr.id, createEditUrl(req, view));
+ Map<String, ?> data =
+ new BlobSoyData(wr.getObjectReader(), view)
+ .toSoyData(wr.path, wr.id, createEditUrl(req, view));
// TODO(sop): Allow caching files by SHA-1 when no S cookie is sent.
renderHtml(
req,
diff --git a/java/com/google/gitiles/ReadmeHelper.java b/java/com/google/gitiles/ReadmeHelper.java
index 389c73c..a15f52c 100644
--- a/java/com/google/gitiles/ReadmeHelper.java
+++ b/java/com/google/gitiles/ReadmeHelper.java
@@ -58,7 +58,9 @@
}
void scanTree(RevTree tree)
- throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException,
+ throws MissingObjectException,
+ IncorrectObjectTypeException,
+ CorruptObjectException,
IOException {
if (config.render) {
try (TreeWalk tw = new TreeWalk(reader)) {
diff --git a/java/com/google/gitiles/VisibilityChecker.java b/java/com/google/gitiles/VisibilityChecker.java
index dedf547..0183ea9 100644
--- a/java/com/google/gitiles/VisibilityChecker.java
+++ b/java/com/google/gitiles/VisibilityChecker.java
@@ -68,7 +68,8 @@
return false;
}
- return !walk.getObjectReader().createReachabilityChecker(walk)
+ return !walk.getObjectReader()
+ .createReachabilityChecker(walk)
.areAllReachable(ImmutableList.of(commit), startCommits.stream())
.isPresent();
}
diff --git a/java/com/google/gitiles/doc/Navbar.java b/java/com/google/gitiles/doc/Navbar.java
index 60d1059..6d9e567 100644
--- a/java/com/google/gitiles/doc/Navbar.java
+++ b/java/com/google/gitiles/doc/Navbar.java
@@ -137,8 +137,11 @@
}
private static Set<String> splitExtensionNames(String url) {
- return Splitter.on(CharMatcher.whitespace().or(CharMatcher.is(','))).trimResults()
- .omitEmptyStrings().splitToList(url).stream()
+ return Splitter.on(CharMatcher.whitespace().or(CharMatcher.is(',')))
+ .trimResults()
+ .omitEmptyStrings()
+ .splitToList(url)
+ .stream()
.map(String::toLowerCase)
.collect(toSet());
}
diff --git a/javatests/com/google/gitiles/DiffServletTest.java b/javatests/com/google/gitiles/DiffServletTest.java
index 529c349..295418e 100644
--- a/javatests/com/google/gitiles/DiffServletTest.java
+++ b/javatests/com/google/gitiles/DiffServletTest.java
@@ -45,7 +45,8 @@
String diffHeader =
String.format(
- "diff --git <a href=\"/b/repo/+/%s/foo\">a/foo</a> <a href=\"/b/repo/+/%s/foo\">b/foo</a>",
+ "diff --git <a href=\"/b/repo/+/%s/foo\">a/foo</a> <a"
+ + " href=\"/b/repo/+/%s/foo\">b/foo</a>",
c1.name(), c2.name());
assertThat(actual).contains(diffHeader);
}
diff --git a/javatests/com/google/gitiles/PathServletTest.java b/javatests/com/google/gitiles/PathServletTest.java
index 7531242..660cc2f 100644
--- a/javatests/com/google/gitiles/PathServletTest.java
+++ b/javatests/com/google/gitiles/PathServletTest.java
@@ -110,7 +110,8 @@
Map<String, ?> data = buildData("/repo/+/refs/heads/master/editFoo");
String editUrl = (String) getBlobData(data).get("editUrl");
- String testUrl = "http://test-host-review/admin/repos/edit/repo/repo/branch/refs/heads/master/file/editFoo";
+ String testUrl =
+ "http://test-host-review/admin/repos/edit/repo/repo/branch/refs/heads/master/file/editFoo";
assertThat(editUrl).isEqualTo(testUrl);
}