Allow to build api with Java 8
Java 8's javadoc fails hard on unknown HTML tags. Due some
documentation code snippets that contain generics and lacked a
{@code...}, the code got picked up as html, which made the target fail
like:
[...]/extensions/registration/DynamicSet.java:64: error: unknown tag: Foo
* DynamicSet.setOf(binder(), new TypeLiteral<Thing<Foo>>() {});
We insert the needed {@code...} to make the build pass for Java 8.
Change-Id: I430b8eb9f2f158c2c7a2a7a8d93446eff3253529
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
index 1388637..7de740dc 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
@@ -67,7 +67,9 @@
* <p>
* Items must be defined in a Guice module before they can be bound:
* <pre>
+ * {@code
* DynamicSet.itemOf(binder(), new TypeLiteral<Thing<Foo>>() {});
+ * }
* </pre>
*
* @param binder a new binder created in the module.
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java
index abf944a..b777899 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java
@@ -67,10 +67,12 @@
* Maps must be defined in a Guice module before they can be bound:
*
* <pre>
+ * {@code
* DynamicMap.mapOf(binder(), new TypeLiteral<Thing<Bar>>(){});
* bind(new TypeLiteral<Thing<Bar>>() {})
* .annotatedWith(Exports.named("foo"))
* .to(Impl.class);
+ * }
* </pre>
*
* @param binder a new binder created in the module.
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java
index 82613c7..8bc39a5 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java
@@ -61,7 +61,9 @@
* <p>
* Sets must be defined in a Guice module before they can be bound:
* <pre>
+ * {@code
* DynamicSet.setOf(binder(), new TypeLiteral<Thing<Foo>>() {});
+ * }
* </pre>
*
* @param binder a new binder created in the module.
diff --git a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtmlBuilder.java b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtmlBuilder.java
index 69da38d..0e7f7eb 100644
--- a/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtmlBuilder.java
+++ b/gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtmlBuilder.java
@@ -162,7 +162,7 @@
}
/**
- * Open an element, appending "<tagName>" to the buffer.
+ * Open an element, appending "{@code <tagName>}" to the buffer.
* <p>
* After the element is open the attributes may be manipulated until the next
* {@code append}, {@code openElement}, {@code closeSelf} or
diff --git a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/SshInfoServlet.java b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/SshInfoServlet.java
index 83120e0..b85cdf0 100644
--- a/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/SshInfoServlet.java
+++ b/gerrit-httpd/src/main/java/com/google/gerrit/httpd/raw/SshInfoServlet.java
@@ -40,12 +40,14 @@
* <p>
* Versions of Git before 1.5.3 may require setting the username and port
* properties in the user's {@code ~/.ssh/config} file, and using a host
- * alias through a URL such as <code>gerrit-alias:/tools/gerrit.git:
+ * alias through a URL such as {@code gerrit-alias:/tools/gerrit.git}:
* <pre>
+ * {@code
* Host gerrit-alias
* User sop@google.com
* Hostname gerrit.com
* Port 8010
+ * }
* </pre>
*/
@SuppressWarnings("serial")
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/account/AccountsCollection.java b/gerrit-server/src/main/java/com/google/gerrit/server/account/AccountsCollection.java
index efe7322..80a451a 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/account/AccountsCollection.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/account/AccountsCollection.java
@@ -77,9 +77,9 @@
* Parses a account ID from a request body and returns the user.
*
* @param id ID of the account, can be a string of the format
- * "Full Name <email@example.com>", just the email address, a full name
- * if it is unique, an account ID, a user name or 'self' for the
- * calling user
+ * "{@code Full Name <email@example.com>}", just the email address,
+ * a full name if it is unique, an account ID, a user name or
+ * "{@code self}" for the calling user
* @return the user, never null.
* @throws UnprocessableEntityException thrown if the account ID cannot be
* resolved or if the account is not visible to the calling user
@@ -102,9 +102,9 @@
* check whether the current user can see the account.
*
* @param id ID of the account, can be a string of the format
- * "Full Name <email@example.com>", just the email address, a full name
- * if it is unique, an account ID, a user name or 'self' for the
- * calling user
+ * "{@code Full Name <email@example.com>}", just the email address,
+ * a full name if it is unique, an account ID, a user name or
+ * "{@code self}" for the calling user
* @return the user, null if no user is found for the given account ID
* @throws AuthException thrown if 'self' is used as account ID and the
* current user is not authenticated
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/change/ReviewerSuggestionCache.java b/gerrit-server/src/main/java/com/google/gerrit/server/change/ReviewerSuggestionCache.java
index 554d760..4120e43 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/change/ReviewerSuggestionCache.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/change/ReviewerSuggestionCache.java
@@ -36,8 +36,8 @@
/**
* The suggest oracle may be called many times in rapid succession during the
* course of one operation.
- * It would be easy to have a simple Cache<Boolean, List<Account>> with a short
- * expiration time of 30s.
+ * It would be easy to have a simple {@code Cache<Boolean, List<Account>>}
+ * with a short expiration time of 30s.
* Cache only has a single key we're just using Cache for the expiration behavior.
*/
@Singleton
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java b/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
index 3754674..a437085 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/config/PluginConfigFactory.java
@@ -239,13 +239,14 @@
/**
* Returns the configuration for the specified plugin that is stored in the
- * plugin configuration file 'etc/<plugin-name>.config'.
+ * plugin configuration file '{@code etc/<plugin-name>.config}'.
*
* The plugin configuration is only loaded once and is then cached.
*
* @param pluginName the name of the plugin for which the configuration should
* be returned
- * @return the plugin configuration from the 'etc/<plugin-name>.config' file
+ * @return the plugin configuration from the
+ * '{@code etc/<plugin-name>.config}' file
*/
public synchronized Config getGlobalPluginConfig(String pluginName) {
if (pluginConfigs.containsKey(pluginName)) {
@@ -274,15 +275,15 @@
/**
* Returns the configuration for the specified plugin that is stored in the
- * '<plugin-name>.config' file in the 'refs/meta/config' branch of the
- * specified project.
+ * '{@code <plugin-name>.config}' file in the 'refs/meta/config' branch of
+ * the specified project.
*
* @param projectName the name of the project for which the plugin
* configuration should be returned
* @param pluginName the name of the plugin for which the configuration should
* be returned
- * @return the plugin configuration from the '<plugin-name>.config' file of
- * the specified project
+ * @return the plugin configuration from the '{@code <plugin-name>.config}'
+ * file of the specified project
* @throws NoSuchProjectException thrown if the specified project does not
* exist
*/
@@ -293,15 +294,15 @@
/**
* Returns the configuration for the specified plugin that is stored in the
- * '<plugin-name>.config' file in the 'refs/meta/config' branch of the
- * specified project.
+ * '{@code <plugin-name>.config}' file in the 'refs/meta/config' branch of
+ * the specified project.
*
* @param projectState the project for which the plugin configuration should
* be returned
* @param pluginName the name of the plugin for which the configuration should
* be returned
- * @return the plugin configuration from the '<plugin-name>.config' file of
- * the specified project
+ * @return the plugin configuration from the '{@code <plugin-name>.config}'
+ * file of the specified project
*/
public Config getProjectPluginConfig(ProjectState projectState,
String pluginName) {
@@ -310,10 +311,10 @@
/**
* Returns the configuration for the specified plugin that is stored in the
- * '<plugin-name>.config' file in the 'refs/meta/config' branch of the
- * specified project. Parameters which are not set in the
- * '<plugin-name>.config' of this project are inherited from the parent
- * project's '<plugin-name>.config' files.
+ * '{@code <plugin-name>.config}' file in the 'refs/meta/config' branch of
+ * the specified project. Parameters which are not set in the
+ * '{@code <plugin-name>.config}' of this project are inherited from the
+ * parent project's '{@code <plugin-name>.config}' files.
*
* E.g.: child project: [mySection "mySubsection"] myKey = childValue
*
@@ -327,9 +328,9 @@
* configuration should be returned
* @param pluginName the name of the plugin for which the configuration should
* be returned
- * @return the plugin configuration from the '<plugin-name>.config' file of
- * the specified project with inheriting non-set parameters from the
- * parent projects
+ * @return the plugin configuration from the '{@code <plugin-name>.config}'
+ * file of the specified project with inheriting non-set parameters
+ * from the parent projects
* @throws NoSuchProjectException thrown if the specified project does not
* exist
*/
@@ -340,10 +341,10 @@
/**
* Returns the configuration for the specified plugin that is stored in the
- * '<plugin-name>.config' file in the 'refs/meta/config' branch of the
- * specified project. Parameters which are not set in the
- * '<plugin-name>.config' of this project are inherited from the parent
- * project's '<plugin-name>.config' files.
+ * '{@code <plugin-name>.config}' file in the 'refs/meta/config' branch of
+ * the specified project. Parameters which are not set in the
+ * '{@code <plugin-name>.config}' of this project are inherited from the
+ * parent project's '{@code <plugin-name>.config}' files.
*
* E.g.: child project: [mySection "mySubsection"] myKey = childValue
*
@@ -357,9 +358,9 @@
* be returned
* @param pluginName the name of the plugin for which the configuration should
* be returned
- * @return the plugin configuration from the '<plugin-name>.config' file of
- * the specified project with inheriting non-set parameters from the
- * parent projects
+ * @return the plugin configuration from the '{@code <plugin-name>.config}'
+ * file of the specified project with inheriting non-set parameters
+ * from the parent projects
*/
public Config getProjectPluginConfigWithInheritance(ProjectState projectState,
String pluginName) {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginEntry.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginEntry.java
index 7242e98..74ded73 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginEntry.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginEntry.java
@@ -23,7 +23,7 @@
* Plugin static resource entry
*
* Bean representing a static resource inside a plugin.
- * All static resources are available at <plugin web url>/static
+ * All static resources are available at {@code <plugin web url>/static}
* and served by the HttpPluginServlet.
*/
public class PluginEntry {
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/util/RangeUtil.java b/gerrit-server/src/main/java/com/google/gerrit/server/util/RangeUtil.java
index adacb21..92873d3 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/util/RangeUtil.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/util/RangeUtil.java
@@ -46,7 +46,7 @@
/**
* Determine the range of values being requested in the given query.
*
- * @param rangeQuery the raw query, e.g. "added:>12345"
+ * @param rangeQuery the raw query, e.g. "{@code added:>12345}"
* @param minValue the minimum possible value for the field, inclusive
* @param maxValue the maximum possible value for the field, inclusive
* @return the calculated {@link Range}, or null if the query is invalid
diff --git a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java
index cdaf20e..bd9a456 100644
--- a/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java
+++ b/gerrit-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java
@@ -127,12 +127,14 @@
* <p>
* Versions of Git before 1.5.3 may require setting the username and port
* properties in the user's {@code ~/.ssh/config} file, and using a host
- * alias through a URL such as <code>gerrit-alias:/tools/gerrit.git:
+ * alias through a URL such as {@code gerrit-alias:/tools/gerrit.git}:
* <pre>
+ * {@code
* Host gerrit-alias
* User sop@google.com
* Hostname gerrit.com
* Port 8010
+ * }
* </pre>
*/
@Singleton