Fail Gradle build for Javadoc warnings

In order to catch Javadoc errors in the build, we now enable the
`Xwerror` flag for the `javadoc` tool. In addition, we now use
`Xdoclint:syntax` instead of `Xdoclint:none` in order to validate
syntax within our Javadoc.

This commit fixes all resulting Javadoc errors and warnings.

This commit also upgrades to Undertow 2.2.12.Final and fixes the
artifact names for exclusions for the Servlet and annotations APIs.

The incorrect exclusion of the Servlet API resulted in the Servlet API
being on the classpath twice for the javadoc task, which resulted in the
following warnings in previous builds.

javadoc: warning - Multiple sources of package comments found for package "javax.servlet"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.http"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.descriptor"
javadoc: warning - Multiple sources of package comments found for package "javax.servlet.annotation"

Closes gh-27480
This commit is contained in:
Sam Brannen
2021-09-29 14:02:37 +02:00
parent 040445612f
commit 96e4d3a530
81 changed files with 251 additions and 250 deletions

View File

@@ -1268,7 +1268,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
/**
* No handler found -> set appropriate HTTP response status.
* No handler found → set appropriate HTTP response status.
* @param request current HTTP request
* @param response current HTTP response
* @throws Exception if preparing the response failed

View File

@@ -303,7 +303,7 @@ public class ModelAndView {
/**
* Add all attributes contained in the provided Map to the model.
* @param modelMap a Map of attributeName -> attributeValue pairs
* @param modelMap a Map of attributeName → attributeValue pairs
* @see ModelMap#addAllAttributes(Map)
* @see #getModelMap()
*/

View File

@@ -582,7 +582,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .nest(RequestPredicates.path("/user"), () ->
* .nest(RequestPredicates.path("/user"), () -&gt;
* RouterFunctions.route()
* .GET(this::listUsers)
* .POST(this::createUser)
@@ -607,7 +607,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .nest(RequestPredicates.path("/user"), builder ->
* .nest(RequestPredicates.path("/user"), builder -&gt;
* builder.GET(this::listUsers)
* .POST(this::createUser))
* .build();
@@ -652,7 +652,7 @@ public abstract class RouterFunctions {
* <pre class="code">
* RouterFunction&lt;ServerResponse&gt; nestedRoute =
* RouterFunctions.route()
* .path("/user", builder ->
* .path("/user", builder -&gt;
* builder.GET(this::listUsers)
* .POST(this::createUser))
* .build();
@@ -674,7 +674,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .filter((request, next) -> {
* .filter((request, next) -&gt; {
* // check for authentication headers
* if (isAuthenticated(request)) {
* return next.handle(request);
@@ -700,7 +700,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .before(request -> {
* .before(request -&gt; {
* log(request);
* return request;
* })
@@ -721,7 +721,7 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .after((request, response) -> {
* .after((request, response) -&gt; {
* log(response);
* return response;
* })
@@ -741,8 +741,8 @@ public abstract class RouterFunctions {
* RouterFunction&lt;ServerResponse&gt; filteredRoute =
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .onError(e -> e instanceof IllegalStateException,
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .onError(e -&gt; e instanceof IllegalStateException,
* (e, request) -&gt; ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .build();
* </pre>
* @param predicate the type of exception to filter
@@ -762,7 +762,7 @@ public abstract class RouterFunctions {
* RouterFunctions.route()
* .GET("/user", this::listUsers)
* .onError(IllegalStateException.class,
* (e, request) -> ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* (e, request) -&gt; ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR).build())
* .build();
* </pre>
* @param exceptionType the type of exception to filter

View File

@@ -259,7 +259,7 @@ public interface ServerRequest {
* public ServerResponse myHandleMethod(ServerRequest request) {
* Instant lastModified = // application-specific calculation
* return request.checkNotModified(lastModified)
* .orElseGet(() -> {
* .orElseGet(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* });
@@ -293,7 +293,7 @@ public interface ServerRequest {
* public ServerResponse myHandleMethod(ServerRequest request) {
* String eTag = // application-specific calculation
* return request.checkNotModified(eTag)
* .orElseGet(() -> {
* .orElseGet(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* });
@@ -330,7 +330,7 @@ public interface ServerRequest {
* Instant lastModified = // application-specific calculation
* String eTag = // application-specific calculation
* return request.checkNotModified(lastModified, eTag)
* .orElseGet(() -> {
* .orElseGet(() -&gt; {
* // further request processing, actually building content
* return ServerResponse.ok().body(...);
* });

View File

@@ -267,14 +267,14 @@ public interface ServerResponse {
* <p>For example:
* <pre class="code">
* public ServerResponse handleSse(ServerRequest request) {
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
* return ServerResponse.sse(sse -&gt; sse.send("Hello World!"));
* }
* </pre>
*
* <p>or, to set both the id and event type:
* <pre class="code">
* public ServerResponse handleSse(ServerRequest request) {
* return ServerResponse.sse(sse -> sse
* return ServerResponse.sse(sse -&gt; sse
* .id("42)
* .event("event")
* .send("Hello World!"));
@@ -296,14 +296,14 @@ public interface ServerResponse {
* <p>For example:
* <pre class="code">
* public ServerResponse handleSse(ServerRequest request) {
* return ServerResponse.sse(sse -> sse.send("Hello World!"));
* return ServerResponse.sse(sse -&gt; sse.send("Hello World!"));
* }
* </pre>
*
* <p>or, to set both the id and event type:
* <pre class="code">
* public ServerResponse handleSse(ServerRequest request) {
* return ServerResponse.sse(sse -> sse
* return ServerResponse.sse(sse -&gt; sse
* .id("42)
* .event("event")
* .send("Hello World!"));

View File

@@ -61,7 +61,6 @@ import org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver;
* <p>This exception resolver is enabled by default in the common Spring
* {@link org.springframework.web.servlet.DispatcherServlet}.
*
* <p>
* <table>
* <caption>Supported Exceptions</caption>
* <thead>

View File

@@ -244,7 +244,7 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
* <ul>
* <li>seconds == -1 (default value): no generation cache-related headers</li>
* <li>seconds == 0: "Cache-Control: no-store" will prevent caching</li>
* <li>seconds > 0: "Cache-Control: max-age=seconds" will ask to cache content</li>
* <li>seconds &gt; 0: "Cache-Control: max-age=seconds" will ask to cache content</li>
* </ul>
* <p>For more specific needs, a custom {@link org.springframework.http.CacheControl}
* should be used.

View File

@@ -51,7 +51,7 @@ import org.springframework.web.util.WebUtils;
* &lt;/bean&gt;</pre>
*
* Every view name returned from a handler will be translated to a JSP
* resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using
* resource (for example: "myView" &rarr; "/WEB-INF/jsp/myView.jsp"), using
* this view class by default.
*
* @author Rod Johnson

View File

@@ -47,7 +47,7 @@ import org.springframework.web.servlet.support.RequestContext;
* &lt;/bean&gt;</pre>
*
* Every view name returned from a handler will be translated to a JSP
* resource (for example: "myView" -> "/WEB-INF/jsp/myView.jsp"), using
* resource (for example: "myView" &rarr; "/WEB-INF/jsp/myView.jsp"), using
* this view class to enable explicit JSTL support.
*
* <p>The specified MessageSource loads messages from "messages.properties" etc

View File

@@ -49,7 +49,7 @@ import org.springframework.web.servlet.View;
* specified prefix and/or suffix. Exporting an attribute that holds the
* RequestContext to all views is explicitly supported.
*
* <p>Example: prefix="/WEB-INF/jsp/", suffix=".jsp", viewname="test" ->
* <p>Example: prefix="/WEB-INF/jsp/", suffix=".jsp", viewname="test" &rarr;
* "/WEB-INF/jsp/test.jsp"
*
* <p>As a special feature, redirect URLs can be specified via the "redirect:"
@@ -342,14 +342,16 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
}
/**
* Specify whether views resolved by this resolver should add path variables to the model or not.
* <p>>The default setting is to let each View decide (see {@link AbstractView#setExposePathVariables}.
* However, you can use this property to override that.
* Specify whether views resolved by this resolver should add path
* variables to the model or not.
* <p>The default setting is to let each View decide
* (see {@link AbstractView#setExposePathVariables}). However, you
* can use this property to override that.
* @param exposePathVariables
* <ul>
* <li>{@code true} - all Views resolved by this resolver will expose path variables
* <li>{@code false} - no Views resolved by this resolver will expose path variables
* <li>{@code null} - individual Views can decide for themselves (this is used by the default)
* <li>{@code null} - individual Views can decide for themselves (this is used by default)
* </ul>
* @see AbstractView#setExposePathVariables
*/

View File

@@ -29,7 +29,7 @@ import com.rometools.rome.feed.atom.Feed;
* Abstract superclass for Atom Feed views, using the
* <a href="https://github.com/rometools/rome">ROME</a> package.
*
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
*
* <p>Application-specific view classes will extend this class.

View File

@@ -33,7 +33,7 @@ import org.springframework.web.servlet.view.AbstractView;
* Abstract base class for Atom and RSS Feed views, using the
* <a href="https://github.com/rometools/rome">ROME</a> package.
*
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
*
* <p>Application-specific view classes will typically extend from either

View File

@@ -31,7 +31,7 @@ import org.springframework.http.MediaType;
* Abstract superclass for RSS Feed views, using the
* <a href="https://github.com/rometools/rome">ROME</a> package.
*
* <p>><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* <p><b>NOTE: As of Spring 4.1, this is based on the {@code com.rometools}
* variant of ROME, version 1.5. Please upgrade your build dependency.</b>
*
* <p>Application-specific view classes will extend this class.

View File

@@ -42,7 +42,7 @@ import org.springframework.web.context.ServletContextAware;
*
* <pre class="code">
* &lt;bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"&gt;
* &lt;property name="templateLoaderPath"&gt;&lt;value&gt;/WEB-INF/freemarker/&lt;/value>&lt;/property&gt;
* &lt;property name="templateLoaderPath"&gt;&lt;value&gt;/WEB-INF/freemarker/&lt;/value&gt;&lt;/property&gt;
* &lt;/bean&gt;</pre>
*
* This bean must be included in the application context of any application

View File

@@ -88,17 +88,17 @@ import org.springframework.web.context.ServletContextAware;
* <p>A typical TilesConfigurer bean definition looks as follows:
*
* <pre class="code">
* &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
* &lt;property name="definitions">
* &lt;list>
* &lt;value>/WEB-INF/defs/general.xml&lt;/value>
* &lt;value>/WEB-INF/defs/widgets.xml&lt;/value>
* &lt;value>/WEB-INF/defs/administrator.xml&lt;/value>
* &lt;value>/WEB-INF/defs/customer.xml&lt;/value>
* &lt;value>/WEB-INF/defs/templates.xml&lt;/value>
* &lt;/list>
* &lt;/property>
* &lt;/bean>
* &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"&gt;
* &lt;property name="definitions"&gt;
* &lt;list&gt;
* &lt;value&gt;/WEB-INF/defs/general.xml&lt;/value&gt;
* &lt;value&gt;/WEB-INF/defs/widgets.xml&lt;/value&gt;
* &lt;value&gt;/WEB-INF/defs/administrator.xml&lt;/value&gt;
* &lt;value&gt;/WEB-INF/defs/customer.xml&lt;/value&gt;
* &lt;value&gt;/WEB-INF/defs/templates.xml&lt;/value&gt;
* &lt;/list&gt;
* &lt;/property&gt;
* &lt;/bean&gt;
* </pre>
*
* The values in the list are the actual Tiles XML files containing the definitions.
@@ -108,14 +108,14 @@ import org.springframework.web.context.ServletContextAware;
* definitions is used to indicate locale information, for example:
*
* <pre class="code">
* &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
* &lt;property name="definitions">
* &lt;list>
* &lt;value>/WEB-INF/defs/tiles.xml&lt;/value>
* &lt;value>/WEB-INF/defs/tiles_fr_FR.xml&lt;/value>
* &lt;/list>
* &lt;/property>
* &lt;/bean>
* &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"&gt;
* &lt;property name="definitions"&gt;
* &lt;list&gt;
* &lt;value&gt;/WEB-INF/defs/tiles.xml&lt;/value&gt;
* &lt;value&gt;/WEB-INF/defs/tiles_fr_FR.xml&lt;/value&gt;
* &lt;/list&gt;
* &lt;/property&gt;
* &lt;/bean&gt;
* </pre>
*
* @author mick semb wever