Rerun google-java-format with a new version There was some drift in our code that hadn't been updated, but the biggest change is that Javadoc comments are now reflowed and HTML regularized. Change-Id: I859f0fdd4d721b22a3fd82601379d730e663e8ad
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/BaseServlet.java b/gitiles-servlet/src/main/java/com/google/gitiles/BaseServlet.java index 6e27cc9..70c48f1 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/BaseServlet.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/BaseServlet.java
@@ -132,8 +132,7 @@ /** * @param req in-progress request. - * @return the default {@link FormatType} used when {@code ?format=} is not - * specified. + * @return the default {@link FormatType} used when {@code ?format=} is not specified. */ protected FormatType getDefaultFormat(HttpServletRequest req) { return HTML; @@ -192,8 +191,8 @@ * * @param req in-progress request. * @param res in-progress response. - * @param templateName Soy template name; must be in one of the template files - * defined in {@link Renderer}. + * @param templateName Soy template name; must be in one of the template files defined in {@link + * Renderer}. * @param soyData data for Soy. * @throws IOException an error occurred during rendering. */ @@ -205,20 +204,18 @@ /** * Start a streaming HTML response with header and footer rendered by Soy. - * <p> - * A streaming template includes the special template - * {@code gitiles.streamingPlaceholder} at the point where data is to be - * streamed. The template before and after this placeholder is rendered using - * the provided data map. + * + * <p>A streaming template includes the special template {@code gitiles.streamingPlaceholder} at + * the point where data is to be streamed. The template before and after this placeholder is + * rendered using the provided data map. * * @param req in-progress request. * @param res in-progress response. - * @param templateName Soy template name; must be in one of the template files - * defined in {@link Renderer}. + * @param templateName Soy template name; must be in one of the template files defined in {@link + * Renderer}. * @param soyData data for Soy. - * @return output stream to render to. The portion of the template before the - * placeholder is already written and flushed; the portion after is - * written only on calling {@code close()}. + * @return output stream to render to. The portion of the template before the placeholder is + * already written and flushed; the portion after is written only on calling {@code close()}. * @throws IOException an error occurred during rendering the header. */ protected OutputStream startRenderStreamingHtml( @@ -295,14 +292,11 @@ /** * Prepare the response to render plain text. - * <p> - * Unlike - * {@link #renderHtml(HttpServletRequest, HttpServletResponse, String, Map)} - * and - * {@link #renderJson(HttpServletRequest, HttpServletResponse, Object, Type)}, - * which assume the data to render is already completely prepared, this method - * does not write any data, only headers, and returns the response's - * ready-to-use writer. + * + * <p>Unlike {@link #renderHtml(HttpServletRequest, HttpServletResponse, String, Map)} and {@link + * #renderJson(HttpServletRequest, HttpServletResponse, Object, Type)}, which assume the data to + * render is already completely prepared, this method does not write any data, only headers, and + * returns the response's ready-to-use writer. * * @param req in-progress request. * @param res in-progress response. @@ -320,7 +314,6 @@ * @param res in-progress response. * @param statusCode HTTP status code. * @param message full message text. - * * @throws IOException */ protected void renderTextError(
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/CommentLinkInfo.java b/gitiles-servlet/src/main/java/com/google/gitiles/CommentLinkInfo.java index 7be81ea..2280c0f 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/CommentLinkInfo.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/CommentLinkInfo.java
@@ -25,18 +25,19 @@ import java.util.regex.Pattern; /** - * Converts commit message text to soy data in accordance with - * a commentlink rule. - * <p> - * Example: + * Converts commit message text to soy data in accordance with a commentlink rule. + * + * <p>Example: + * * <pre> * new CommentLinkInfo( * Pattern.compile("bug (\d+)"), * "http://bugs/$1") * .linkify("do something nice\n\nbug 5") * </pre> - * <p> - * returns a list of soy data objects: + * + * <p>returns a list of soy data objects: + * * <pre> * ImmutableList.of( * ImmutableMap.of("text", "do something nice\n\n"),
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/ConfigUtil.java b/gitiles-servlet/src/main/java/com/google/gitiles/ConfigUtil.java index b9700b8..05665c7 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/ConfigUtil.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/ConfigUtil.java
@@ -33,9 +33,9 @@ public class ConfigUtil { /** * Read a duration value from the configuration. - * <p> - * Durations can be written with unit suffixes, for example {@code "1 s"} or - * {@code "5 days"}. If units are not specified, milliseconds are assumed. + * + * <p>Durations can be written with unit suffixes, for example {@code "1 s"} or {@code "5 days"}. + * If units are not specified, milliseconds are assumed. * * @param config JGit config object. * @param section section to read, e.g. "google" @@ -45,7 +45,10 @@ * @return a standard duration representing the time read, or defaultValue. */ public static Duration getDuration( - Config config, String section, String subsection, String name, + Config config, + String section, + String subsection, + String name, @Nullable Duration defaultValue) { long m = config.getTimeUnit(section, subsection, name, -1, MILLISECONDS); return m == -1 ? defaultValue : Duration.millis(m); @@ -91,10 +94,9 @@ * @param section section to read, e.g. "gitiles". * @param subsection subsection to read, e.g. "subsection". * @param name variable to read, e.g. "fixedTimeZone". - * @return a time zone read from parsing the specified config string value, or - * {@link Optional#absent()} if not present. As in the behavior of - * {@link TimeZone#getTimeZone(String)}, unknown time zones are treated as - * GMT. + * @return a time zone read from parsing the specified config string value, or {@link + * Optional#absent()} if not present. As in the behavior of {@link + * TimeZone#getTimeZone(String)}, unknown time zones are treated as GMT. */ public static Optional<TimeZone> getTimeZone( Config config, String section, String subsection, String name) {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultAccess.java b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultAccess.java index 745eef7..0953923 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultAccess.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultAccess.java
@@ -45,10 +45,9 @@ /** * Default implementation of {@link GitilesAccess} with local repositories. - * <p> - * Repositories are scanned on-demand under the given path, configured by - * default from {@code gitiles.basePath}. There is no access control beyond what - * user the JVM is running under. + * + * <p>Repositories are scanned on-demand under the given path, configured by default from {@code + * gitiles.basePath}. There is no access control beyond what user the JVM is running under. */ public class DefaultAccess implements GitilesAccess { private static final String ANONYMOUS_USER_KEY = "anonymous user";
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultUrls.java b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultUrls.java index d6e9bf7..67e42c0 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/DefaultUrls.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/DefaultUrls.java
@@ -22,9 +22,9 @@ /** * Default implementation of {@link GitilesUrls}. - * <p> - * This implementation uses statically-configured defaults, and thus assumes - * that the servlet is running a single virtual host. + * + * <p>This implementation uses statically-configured defaults, and thus assumes that the servlet is + * running a single virtual host. */ public class DefaultUrls implements GitilesUrls { private final String canonicalHostName;
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/DescribeServlet.java b/gitiles-servlet/src/main/java/com/google/gitiles/DescribeServlet.java index 88535d2..785d452 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/DescribeServlet.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/DescribeServlet.java
@@ -97,8 +97,7 @@ SC_BAD_REQUEST, String.format( "Ambiguous short SHA-1 %s (%s)", - e.getAbbreviatedObjectId(), - Joiner.on(", ").join(e.getCandidates()))); + e.getAbbreviatedObjectId(), Joiner.on(", ").join(e.getCandidates()))); return null; } }
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesAccess.java b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesAccess.java index 32002ec..ec3b5ff 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesAccess.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesAccess.java
@@ -25,9 +25,9 @@ /** * Git storage interface for Gitiles. - * <p> - * Each instance is associated with a single end-user request, which implicitly - * includes information about the host and repository. + * + * <p>Each instance is associated with a single end-user request, which implicitly includes + * information about the host and repository. */ public interface GitilesAccess { /** Factory for per-request access. */ @@ -38,26 +38,22 @@ /** * List repositories on the host. * - * @param prefix repository base path to list. Trailing "/" is implicitly - * added if missing. Null or empty string will match all repositories. + * @param prefix repository base path to list. Trailing "/" is implicitly added if missing. Null + * or empty string will match all repositories. * @param branches branches to list along with each repository. * @return map of repository names to descriptions. - * @throws ServiceNotEnabledException to trigger an HTTP 403 Forbidden - * (matching behavior in - * {@link org.eclipse.jgit.http.server.RepositoryFilter}). - * @throws ServiceNotAuthorizedException to trigger an HTTP 401 Unauthorized - * (matching behavior in - * {@link org.eclipse.jgit.http.server.RepositoryFilter}). + * @throws ServiceNotEnabledException to trigger an HTTP 403 Forbidden (matching behavior in + * {@link org.eclipse.jgit.http.server.RepositoryFilter}). + * @throws ServiceNotAuthorizedException to trigger an HTTP 401 Unauthorized (matching behavior in + * {@link org.eclipse.jgit.http.server.RepositoryFilter}). * @throws IOException if an error occurred. */ - Map<String, RepositoryDescription> listRepositories( - @Nullable String prefix, Set<String> branches) + Map<String, RepositoryDescription> listRepositories(@Nullable String prefix, Set<String> branches) throws ServiceNotEnabledException, ServiceNotAuthorizedException, IOException; /** - * @return an opaque object that uniquely identifies the end-user making the - * request, and supports {@link Object#equals(Object)} and - * {@link Object#hashCode()}. Never null. + * @return an opaque object that uniquely identifies the end-user making the request, and supports + * {@link Object#equals(Object)} and {@link Object#hashCode()}. Never null. */ Object getUserKey(); @@ -66,8 +62,7 @@ /** * @return the description attached to the repository of this request. - * @throws IOException an error occurred reading the description string from - * the repository. + * @throws IOException an error occurred reading the description string from the repository. */ RepositoryDescription getRepositoryDescription() throws IOException;
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesFilter.java b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesFilter.java index 4e362a5..3820521 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesFilter.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesFilter.java
@@ -55,8 +55,8 @@ /** * MetaFilter to serve Gitiles. - * <p> - * Do not use directly; use {@link GitilesServlet}. + * + * <p>Do not use directly; use {@link GitilesServlet}. */ class GitilesFilter extends MetaFilter {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesServlet.java b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesServlet.java index 05a2669..3cf4fd2 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesServlet.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesServlet.java
@@ -30,11 +30,10 @@ /** * Servlet to serve Gitiles. - * <p> - * This servlet can either be constructed manually with its dependencies, or - * configured to use default implementations for the Gitiles interfaces. To - * configure the defaults, you must provide a single init parameter - * "configPath", which is the path to a git config file containing additional + * + * <p>This servlet can either be constructed manually with its dependencies, or configured to use + * default implementations for the Gitiles interfaces. To configure the defaults, you must provide a + * single init parameter "configPath", which is the path to a git config file containing additional * configuration. */ public class GitilesServlet extends MetaServlet { @@ -105,8 +104,8 @@ /** * Add a custom filter for a view. - * <p> - * Must be called before initializing the servlet. + * + * <p>Must be called before initializing the servlet. * * @param view view type. * @param filter filter. @@ -117,8 +116,8 @@ /** * Set a custom handler for a view. - * <p> - * Must be called before initializing the servlet. + * + * <p>Must be called before initializing the servlet. * * @param view view type. * @param handler handler.
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesUrls.java b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesUrls.java index 50171c3..2d07c49 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesUrls.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesUrls.java
@@ -25,13 +25,12 @@ public interface GitilesUrls { /** * Escapes repository or path names to be safely embedded into a URL. - * <p> - * This escape implementation escapes a repository or path name such as - * "foo/bar</child" to appear as "foo/bar%3C/child". Spaces are escaped as - * "%20". Its purpose is to escape a repository name to be safe for inclusion - * in the path component of the URL, where "/" is a valid character that - * should not be encoded, while almost any other non-alpha, non-numeric - * character will be encoded using URL style encoding. + * + * <p>This escape implementation escapes a repository or path name such as "foo/bar</child" to + * appear as "foo/bar%3C/child". Spaces are escaped as "%20". Its purpose is to escape a + * repository name to be safe for inclusion in the path component of the URL, where "/" is a valid + * character that should not be encoded, while almost any other non-alpha, non-numeric character + * will be encoded using URL style encoding. */ Function<String, String> NAME_ESCAPER = new Function<String, String>() { @@ -53,7 +52,7 @@ /** * Return the name of the host from the request. * - * Used in various user-visible text, like "MyHost Git Repositories". + * <p>Used in various user-visible text, like "MyHost Git Repositories". * * @param req request. * @return host name; may be null. @@ -72,8 +71,7 @@ * Return the base URL for Gerrit projects on this host. * * @param req request. - * @return base URL for Gerrit Code Review, or null if Gerrit is not - * configured. + * @return base URL for Gerrit Code Review, or null if Gerrit is not configured. */ String getBaseGerritUrl(HttpServletRequest req); }
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesView.java b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesView.java index 889c603..c792634 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/GitilesView.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/GitilesView.java
@@ -45,11 +45,10 @@ /** * Information about a view in Gitiles. - * <p> - * Views are uniquely identified by a type, and dispatched to servlet types by - * {@link GitilesServlet}. This class contains the list of all types, as - * well as some methods containing basic information parsed from the URL. - * Construction happens in {@link ViewFilter}. + * + * <p>Views are uniquely identified by a type, and dispatched to servlet types by {@link + * GitilesServlet}. This class contains the list of all types, as well as some methods containing + * basic information parsed from the URL. Construction happens in {@link ViewFilter}. */ public class GitilesView { private static final String DEFAULT_ARCHIVE_EXTENSION = ".tar.gz"; @@ -167,9 +166,8 @@ public Builder setRepositoryPrefix(String prefix) { if (type == Type.HOST_INDEX) { - this.repositoryPrefix = prefix != null - ? Strings.emptyToNull(maybeTrimLeadingAndTrailingSlash(prefix)) - : null; + this.repositoryPrefix = + prefix != null ? Strings.emptyToNull(maybeTrimLeadingAndTrailingSlash(prefix)) : null; return this; } throw new IllegalStateException( @@ -728,9 +726,8 @@ } /** - * @return a list of maps with "text" and "url" keys for all file paths - * leading up to the path represented by this view. All URLs allow - * auto-diving into one-entry subtrees; see also + * @return a list of maps with "text" and "url" keys for all file paths leading up to the path + * represented by this view. All URLs allow auto-diving into one-entry subtrees; see also * {@link #getBreadcrumbs(List)}. */ public List<Map<String, String>> getBreadcrumbs() { @@ -740,13 +737,12 @@ private static final EnumSet<Type> NON_HTML_TYPES = EnumSet.of(Type.DESCRIBE, Type.ARCHIVE); /** - * @param hasSingleTree list of booleans, one per path entry in this view's - * path excluding the leaf. True entries indicate the tree at that path - * only has a single entry that is another tree. - * @return a list of maps with "text" and "url" keys for all file paths - * leading up to the path represented by this view. URLs whose - * corresponding entry in {@code hasSingleTree} is true will disable - * auto-diving into one-entry subtrees. + * @param hasSingleTree list of booleans, one per path entry in this view's path excluding the + * leaf. True entries indicate the tree at that path only has a single entry that is another + * tree. + * @return a list of maps with "text" and "url" keys for all file paths leading up to the path + * represented by this view. URLs whose corresponding entry in {@code hasSingleTree} is true + * will disable auto-diving into one-entry subtrees. */ public List<Map<String, String>> getBreadcrumbs(List<Boolean> hasSingleTree) { checkArgument(!NON_HTML_TYPES.contains(type), "breadcrumbs for %s view not supported", type);
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/Paginator.java b/gitiles-servlet/src/main/java/com/google/gitiles/Paginator.java index ba85828..3060e45 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/Paginator.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/Paginator.java
@@ -39,14 +39,12 @@ /** * Wrapper around {@link RevWalk} that paginates for Gitiles. * - * A single page of a shortlog is defined by a revision range, such as "master" - * or "master..next", a page size, and a start commit, such as "c0ffee". The - * distance between the first commit in the walk ("next") and the first commit - * in the page may be arbitrarily long, but in order to present the commit list - * in a stable way, we must always start from the first commit in the walk. This - * is because there may be arbitrary merge commits between "c0ffee" and "next" - * that effectively insert arbitrary commits into the history starting from - * "c0ffee". + * <p>A single page of a shortlog is defined by a revision range, such as "master" or + * "master..next", a page size, and a start commit, such as "c0ffee". The distance between the first + * commit in the walk ("next") and the first commit in the page may be arbitrarily long, but in + * order to present the commit list in a stable way, we must always start from the first commit in + * the walk. This is because there may be arbitrary merge commits between "c0ffee" and "next" that + * effectively insert arbitrary commits into the history starting from "c0ffee". */ class Paginator implements Iterable<RevCommit> { private static class RenameWatcher extends RenameCallback { @@ -80,8 +78,7 @@ * * @param walk revision walk; must be fully initialized before calling. * @param limit page size. - * @param start commit at which to start the walk, or null to start at the - * beginning. + * @param start commit at which to start the walk, or null to start at the beginning. */ Paginator(RevWalk walk, int limit, @Nullable ObjectId start) throws MissingObjectException, IncorrectObjectTypeException, IOException { @@ -120,7 +117,6 @@ * Get the next element in this page of the walk. * * @return the next element, or null if the walk is finished. - * * @throws MissingObjectException See {@link RevWalk#next()}. * @throws IncorrectObjectTypeException See {@link RevWalk#next()}. * @throws IOException See {@link RevWalk#next()}. @@ -164,33 +160,31 @@ } /** - * @return the ID at the start of the page of results preceding this one, or - * null if this is the first page. + * @return the ID at the start of the page of results preceding this one, or null if this is the + * first page. */ public ObjectId getPreviousStart() { return prevStart; } /** - * @return the ID at the start of the page of results after this one, or null - * if this is the last page. + * @return the ID at the start of the page of results after this one, or null if this is the last + * page. */ public ObjectId getNextStart() { checkState(done, "getNextStart() invalid before walk done"); return nextStart; } - /** - * @return entry corresponding to a rename or copy at the given commit. - */ + /** @return entry corresponding to a rename or copy at the given commit. */ public DiffEntry getRename(ObjectId commitId) { return renamed != null ? renamed.get(commitId) : null; } /** * @return an iterator over the commits in this walk. - * @throws RevWalkException if an error occurred, wrapping the checked - * exception from {@link #next()}. + * @throws RevWalkException if an error occurred, wrapping the checked exception from {@link + * #next()}. */ @Override public Iterator<RevCommit> iterator() {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/PathServlet.java b/gitiles-servlet/src/main/java/com/google/gitiles/PathServlet.java index 1870258..804d5b3 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/PathServlet.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/PathServlet.java
@@ -74,8 +74,8 @@ static final String TYPE_HEADER = "X-Gitiles-Object-Type"; /** - * Submodule URLs where we know there is a web page if the user visits the - * repository URL verbatim in a web browser. + * Submodule URLs where we know there is a web page if the user visits the repository URL verbatim + * in a web browser. */ private static final Pattern VERBATIM_SUBMODULE_URL_PATTERN = Pattern.compile( @@ -344,9 +344,9 @@ /** * Encapsulate the result of walking to a single tree. - * <p> - * Unlike {@link TreeWalk} itself, supports positioning at the root tree. - * Includes information to help the auto-dive routine as well. + * + * <p>Unlike {@link TreeWalk} itself, supports positioning at the root tree. Includes information + * to help the auto-dive routine as well. */ private static class WalkResult implements AutoCloseable { private static WalkResult recursivePath(RevWalk rw, GitilesView view) throws IOException {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/ReadmeHelper.java b/gitiles-servlet/src/main/java/com/google/gitiles/ReadmeHelper.java index 0d625a9..e6c5736 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/ReadmeHelper.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/ReadmeHelper.java
@@ -13,6 +13,7 @@ // limitations under the License. package com.google.gitiles; + import com.google.gitiles.doc.GitilesMarkdown; import com.google.gitiles.doc.MarkdownConfig; import com.google.gitiles.doc.MarkdownToHtml; @@ -101,10 +102,7 @@ log.error( String.format( "error rendering %s/%s %s:%s", - view.getHostName(), - view.getRepositoryName(), - view.getRevision(), - readmePath), + view.getHostName(), view.getRepositoryName(), view.getRevision(), readmePath), err); return null; }
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/Renderer.java b/gitiles-servlet/src/main/java/com/google/gitiles/Renderer.java index f5d6e36..7030694 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/Renderer.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/Renderer.java
@@ -45,9 +45,9 @@ /** * Renderer for Soy templates used by Gitiles. - * <p> - * Most callers should not use the methods in this class directly, and instead - * use one of the HTML methods in {@link BaseServlet}. + * + * <p>Most callers should not use the methods in this class directly, and instead use one of the + * HTML methods in {@link BaseServlet}. */ public abstract class Renderer { // Must match .streamingPlaceholder.
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/Revision.java b/gitiles-servlet/src/main/java/com/google/gitiles/Revision.java index c494af9..3fc8d37 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/Revision.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/Revision.java
@@ -32,9 +32,9 @@ /** * Object encapsulating a single revision as seen by Gitiles. - * <p> - * A single revision consists of a name, an ID, and a type. Name parsing is done - * once per request by {@link RevisionParser}. + * + * <p>A single revision consists of a name, an ID, and a type. Name parsing is done once per request + * by {@link RevisionParser}. */ public class Revision { /** Sentinel indicating a missing or empty revision. */
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/TimeCache.java b/gitiles-servlet/src/main/java/com/google/gitiles/TimeCache.java index dee10d1..1a931e3 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/TimeCache.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/TimeCache.java
@@ -30,10 +30,10 @@ /** * Cache of the time associated with Git objects. - * <p> - * Uses the time as stored in annotated tags if available, or else the commit - * time of the tagged commit. Non-commits are given {@link Long#MIN_VALUE}, - * rather than searching for occurrences in the entire repository. + * + * <p>Uses the time as stored in annotated tags if available, or else the commit time of the tagged + * commit. Non-commits are given {@link Long#MIN_VALUE}, rather than searching for occurrences in + * the entire repository. */ public class TimeCache { public static CacheBuilder<Object, Object> defaultBuilder() {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/TreeSoyData.java b/gitiles-servlet/src/main/java/com/google/gitiles/TreeSoyData.java index 936094c..1e4e4b7 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/TreeSoyData.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/TreeSoyData.java
@@ -36,15 +36,14 @@ /** Soy data converter for git trees. */ public class TreeSoyData { /** - * Number of characters to display for a symlink target. Targets longer than - * this are abbreviated for display in a tree listing. + * Number of characters to display for a symlink target. Targets longer than this are abbreviated + * for display in a tree listing. */ private static final int MAX_SYMLINK_TARGET_LENGTH = 72; /** - * Maximum number of bytes to load from a blob that claims to be a symlink. If - * the blob is larger than this byte limit it will be displayed as a binary - * file instead of as a symlink. + * Maximum number of bytes to load from a blob that claims to be a symlink. If the blob is larger + * than this byte limit it will be displayed as a binary file instead of as a symlink. */ static final int MAX_SYMLINK_SIZE = 16 << 10;
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/BlockNoteExtension.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/BlockNoteExtension.java index 8a7e250..deda75a 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/BlockNoteExtension.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/BlockNoteExtension.java
@@ -28,6 +28,7 @@ /** * CommonMark extension for block notes. + * * <pre> * *** note * This is a note.
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/DocServlet.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/DocServlet.java index 37a1ec6..a55084f 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/DocServlet.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/DocServlet.java
@@ -272,10 +272,7 @@ log.error( String.format( "cannot load markdown %s/%s %s %s", - view.getHostName(), - view.getRepositoryName(), - view.getRevision(), - view.getPathPart()), + view.getHostName(), view.getRepositoryName(), view.getRevision(), view.getPathPart()), err); res.setStatus(SC_INTERNAL_SERVER_ERROR); }
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/GitilesHtmlExtension.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/GitilesHtmlExtension.java index a049fa8..435bb16 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/GitilesHtmlExtension.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/GitilesHtmlExtension.java
@@ -30,10 +30,11 @@ /** * Convert some {@link HtmlInline} and {@link HtmlBlock} to safe types. - * <p> - * Gitiles style Markdown accepts only a very small subset of HTML that is safe - * for use within the document. This {@code PostProcessor} scans parsed nodes - * and converts them to safer types for rendering: + * + * <p>Gitiles style Markdown accepts only a very small subset of HTML that is safe for use within + * the document. This {@code PostProcessor} scans parsed nodes and converts them to safer types for + * rendering: + * * <ul> * <li>{@link HardLineBreak} * <li>{@link ThematicBreak}
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/MarkdownToHtml.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/MarkdownToHtml.java index 5a86d4c..f734949 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/MarkdownToHtml.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/MarkdownToHtml.java
@@ -65,8 +65,8 @@ /** * Formats parsed Markdown AST into HTML. - * <p> - * Callers must create a new instance for each document. + * + * <p>Callers must create a new instance for each document. */ public class MarkdownToHtml implements Visitor { public static Builder builder() {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/MultiColumnBlock.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/MultiColumnBlock.java index 3651474..d26e32c 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/MultiColumnBlock.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/MultiColumnBlock.java
@@ -19,9 +19,9 @@ /** * Multi-column layout delineated by {@code |||---|||}. - * <p> - * Each {@link Heading} or {@link BlockNote} within the layout begins a new - * {@link Column} in the HTML. + * + * <p>Each {@link Heading} or {@link BlockNote} within the layout begins a new {@link Column} in the + * HTML. */ public class MultiColumnBlock extends CustomBlock { /** Grid is 12 columns wide. */
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/PathResolver.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/PathResolver.java index 33feff7..205cecd 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/PathResolver.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/PathResolver.java
@@ -21,14 +21,13 @@ /** * Resolve a path within the repository. * - * @param file path of the Markdown file in the repository that is making the - * reference. May be null. - * @param target destination within the repository. If {@code target} starts - * with {@code '/'}, {@code file} may be null and {@code target} is - * evaluated as from the root directory of the repository. - * @return resolved form of {@code target} within the repository. Null if - * {@code target} is not valid from {@code file}. Does not begin with - * {@code '/'}, even if {@code target} does. + * @param file path of the Markdown file in the repository that is making the reference. May be + * null. + * @param target destination within the repository. If {@code target} starts with {@code '/'}, + * {@code file} may be null and {@code target} is evaluated as from the root directory of the + * repository. + * @return resolved form of {@code target} within the repository. Null if {@code target} is not + * valid from {@code file}. Does not begin with {@code '/'}, even if {@code target} does. */ @Nullable static String resolve(@Nullable String file, String target) {
diff --git a/gitiles-servlet/src/main/java/com/google/gitiles/doc/html/HtmlBuilder.java b/gitiles-servlet/src/main/java/com/google/gitiles/doc/html/HtmlBuilder.java index 26c48e2..9551e94 100644 --- a/gitiles-servlet/src/main/java/com/google/gitiles/doc/html/HtmlBuilder.java +++ b/gitiles-servlet/src/main/java/com/google/gitiles/doc/html/HtmlBuilder.java
@@ -30,14 +30,13 @@ /** * Builds a document fragment using a restricted subset of HTML. - * <p> - * Most attributes are rejected ({@code style}, {@code onclick}, ...) by - * throwing IllegalArgumentException if the caller attempts to add them to a - * pending element. - * <p> - * Useful but critical attributes like {@code href} on anchors or {@code src} on - * img permit only safe subset of URIs, primarily {@code http://}, - * {@code https://}, and for image src {@code data:image/*;base64,...}. + * + * <p>Most attributes are rejected ({@code style}, {@code onclick}, ...) by throwing + * IllegalArgumentException if the caller attempts to add them to a pending element. + * + * <p>Useful but critical attributes like {@code href} on anchors or {@code src} on img permit only + * safe subset of URIs, primarily {@code http://}, {@code https://}, and for image src {@code + * data:image/*;base64,...}. */ public final class HtmlBuilder { private static final ImmutableSet<String> ALLOWED_TAGS =
diff --git a/gitiles-servlet/src/test/java/com/google/gitiles/DiffServletTest.java b/gitiles-servlet/src/test/java/com/google/gitiles/DiffServletTest.java index b89e446..7a2d201 100644 --- a/gitiles-servlet/src/test/java/com/google/gitiles/DiffServletTest.java +++ b/gitiles-servlet/src/test/java/com/google/gitiles/DiffServletTest.java
@@ -47,8 +47,7 @@ String diffHeader = String.format( "diff --git <a href=\"/b/repo/+/%s/foo\">a/foo</a> <a href=\"/b/repo/+/%s/foo\">b/foo</a>", - c1.name(), - c2.name()); + c1.name(), c2.name()); assertThat(actual).contains(diffHeader); }
diff --git a/gitiles-servlet/src/test/java/com/google/gitiles/IdentRevFilterTest.java b/gitiles-servlet/src/test/java/com/google/gitiles/IdentRevFilterTest.java index 43992d5..dacf85e 100644 --- a/gitiles-servlet/src/test/java/com/google/gitiles/IdentRevFilterTest.java +++ b/gitiles-servlet/src/test/java/com/google/gitiles/IdentRevFilterTest.java
@@ -26,10 +26,9 @@ /** * Tests for {@link IdentRevFilter}. * - * Unfortunately it's not easy to test the Filter using real {@link RevCommit}s - * because {@link TestRepository} hard-codes its author as "J. Author". The next - * best thing is to test a {@link PersonIdent}, those are easy to construct. - * TODO(dborowitz): Fix TestRepository to allow this. + * <p>Unfortunately it's not easy to test the Filter using real {@link RevCommit}s because {@link + * TestRepository} hard-codes its author as "J. Author". The next best thing is to test a {@link + * PersonIdent}, those are easy to construct. TODO(dborowitz): Fix TestRepository to allow this. */ @RunWith(JUnit4.class) public class IdentRevFilterTest {
diff --git a/gitiles-servlet/src/test/java/com/google/gitiles/TestGitilesServlet.java b/gitiles-servlet/src/test/java/com/google/gitiles/TestGitilesServlet.java index 836116c..0a7beb1 100644 --- a/gitiles-servlet/src/test/java/com/google/gitiles/TestGitilesServlet.java +++ b/gitiles-servlet/src/test/java/com/google/gitiles/TestGitilesServlet.java
@@ -39,12 +39,12 @@ /** * Create a servlet backed by a single test repository. - * <p> - * The servlet uses the same filter lists as a real servlet, but only knows - * about a single repo, having the name returned by - * {@link org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription#getRepositoryName()}. - * Pass a {@link FakeHttpServletRequest} and {@link FakeHttpServletResponse} - * to the servlet's {@code service} method to test. + * + * <p>The servlet uses the same filter lists as a real servlet, but only knows about a single + * repo, having the name returned by {@link + * org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription#getRepositoryName()}. Pass a + * {@link FakeHttpServletRequest} and {@link FakeHttpServletResponse} to the servlet's {@code + * service} method to test. * * @param repo the test repo backing the servlet. * @param gitwebRedirect optional redirect filter for gitweb URLs.
diff --git a/gitiles-servlet/src/test/java/com/google/gitiles/TimeCacheTest.java b/gitiles-servlet/src/test/java/com/google/gitiles/TimeCacheTest.java index b5a6561..8d38eff 100644 --- a/gitiles-servlet/src/test/java/com/google/gitiles/TimeCacheTest.java +++ b/gitiles-servlet/src/test/java/com/google/gitiles/TimeCacheTest.java
@@ -43,8 +43,8 @@ /** * Start time of {@link #repo}. - * <p> - * Note that commits auto-increment the repo's ticker, but tags do not. + * + * <p>Note that commits auto-increment the repo's ticker, but tags do not. */ private long start;
diff --git a/gitiles-servlet/src/test/java/com/google/gitiles/doc/LinkTest.java b/gitiles-servlet/src/test/java/com/google/gitiles/doc/LinkTest.java index 782a603..a7e08a0 100644 --- a/gitiles-servlet/src/test/java/com/google/gitiles/doc/LinkTest.java +++ b/gitiles-servlet/src/test/java/com/google/gitiles/doc/LinkTest.java
@@ -32,12 +32,13 @@ @Before public void setup() { - view = GitilesView.revision() - .setHostName("127.0.0.1") - .setServletPath("/g") - .setRepositoryName("repo") - .setRevision("HEAD") - .build(); + view = + GitilesView.revision() + .setHostName("127.0.0.1") + .setServletPath("/g") + .setRepositoryName("repo") + .setRevision("HEAD") + .build(); config = new Config(); } @@ -125,8 +126,7 @@ private static void testMarkdownInRoot(MarkdownToHtml md) { assertThat(md.href("#Help")).isEqualTo("#Help"); - assertThat(md.href("setup.md#Help")) - .isEqualTo("/g/repo/+/HEAD/setup.md#Help"); + assertThat(md.href("setup.md#Help")).isEqualTo("/g/repo/+/HEAD/setup.md#Help"); assertThat(md.href("setup.md")).isEqualTo("/g/repo/+/HEAD/setup.md"); assertThat(md.href("./setup.md")).isEqualTo("/g/repo/+/HEAD/setup.md"); @@ -141,8 +141,7 @@ private static void testMarkdownInTree(MarkdownToHtml md) { assertThat(md.href("#Help")).isEqualTo("#Help"); - assertThat(md.href("setup.md#Help")) - .isEqualTo("/g/repo/+/HEAD/doc/setup.md#Help"); + assertThat(md.href("setup.md#Help")).isEqualTo("/g/repo/+/HEAD/doc/setup.md#Help"); assertThat(md.href("setup.md")).isEqualTo("/g/repo/+/HEAD/doc/setup.md"); assertThat(md.href("./setup.md")).isEqualTo("/g/repo/+/HEAD/doc/setup.md");