Merge "Allow to build api with Java 8"

This commit is contained in:
Shawn Pearce
2015-04-10 22:17:04 +00:00
committed by Gerrit Code Review
11 changed files with 48 additions and 37 deletions

View File

@@ -67,7 +67,9 @@ public class DynamicItem<T> {
* <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.

View File

@@ -67,10 +67,12 @@ public abstract class DynamicMap<T> implements Iterable<DynamicMap.Entry<T>> {
* 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(&quot;foo&quot;))
* .to(Impl.class);
* }
* </pre>
*
* @param binder a new binder created in the module.

View File

@@ -61,7 +61,9 @@ public class DynamicSet<T> implements Iterable<T> {
* <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.

View File

@@ -162,7 +162,7 @@ public class SafeHtmlBuilder extends SafeHtml {
}
/**
* 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

View File

@@ -40,12 +40,14 @@ import javax.servlet.http.HttpServletResponse;
* <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")

View File

@@ -77,9 +77,9 @@ public class AccountsCollection implements
* 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 @@ public class AccountsCollection implements
* 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

View File

@@ -36,8 +36,8 @@ import java.util.concurrent.TimeUnit;
/**
* 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

View File

@@ -239,13 +239,14 @@ public class PluginConfigFactory implements ReloadPluginListener {
/**
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
/**
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
/**
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
/**
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
/**
* 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 @@ public class PluginConfigFactory implements ReloadPluginListener {
* 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) {

View File

@@ -23,7 +23,7 @@ import java.util.Map;
* 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 {

View File

@@ -46,7 +46,7 @@ public final class RangeUtil {
/**
* 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

View File

@@ -135,12 +135,14 @@ import java.util.List;
* <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