Merge branch '5.3.x'

# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java
This commit is contained in:
Sam Brannen 2022-07-12 12:01:27 +02:00
commit 983c6e233f
34 changed files with 45 additions and 45 deletions

View File

@ -35,7 +35,7 @@ public interface HandlerAdapter {
/** /**
* Whether this {@code HandlerAdapter} supports the given {@code handler}. * Whether this {@code HandlerAdapter} supports the given {@code handler}.
* @param handler the handler object to check * @param handler the handler object to check
* @return whether or not the handler is supported * @return whether the handler is supported
*/ */
boolean supports(Object handler); boolean supports(Object handler);

View File

@ -32,7 +32,7 @@ public interface HandlerResultHandler {
/** /**
* Whether this handler supports the given {@link HandlerResult}. * Whether this handler supports the given {@link HandlerResult}.
* @param result the result object to check * @param result the result object to check
* @return whether or not this object can use the given result * @return whether this object can use the given result
*/ */
boolean supports(HandlerResult result); boolean supports(HandlerResult result);

View File

@ -31,7 +31,7 @@ import org.springframework.web.server.NotAcceptableStatusException;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
/** /**
* Resolver that checks a query parameter and uses it to lookup a matching * Resolver that checks a query parameter and uses it to look up a matching
* MediaType. Lookup keys can be registered or as a fallback * MediaType. Lookup keys can be registered or as a fallback
* {@link MediaTypeFactory} can be used to perform a lookup. * {@link MediaTypeFactory} can be used to perform a lookup.
* *

View File

@ -159,7 +159,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
} }
/** /**
* Override to plug a sub-class of {@link RequestMappingHandlerMapping}. * Override to plug a subclass of {@link RequestMappingHandlerMapping}.
*/ */
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() { protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
return new RequestMappingHandlerMapping(); return new RequestMappingHandlerMapping();
@ -180,7 +180,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
/** /**
* Callback for building the global CORS configuration. This method is final. * Callback for building the global CORS configuration. This method is final.
* Use {@link #addCorsMappings(CorsRegistry)} to customize the CORS conifg. * Use {@link #addCorsMappings(CorsRegistry)} to customize the CORS config.
*/ */
protected final Map<String, CorsConfiguration> getCorsConfigurations() { protected final Map<String, CorsConfiguration> getCorsConfigurations() {
if (this.corsConfigurations == null) { if (this.corsConfigurations == null) {
@ -192,7 +192,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
} }
/** /**
* Override this method to configure cross origin requests processing. * Override this method to configure cross-origin requests processing.
* @see CorsRegistry * @see CorsRegistry
*/ */
protected void addCorsMappings(CorsRegistry registry) { protected void addCorsMappings(CorsRegistry registry) {
@ -226,7 +226,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
} }
/** /**
* Override to plug a sub-class of {@link RouterFunctionMapping}. * Override to plug a subclass of {@link RouterFunctionMapping}.
*/ */
protected RouterFunctionMapping createRouterFunctionMapping() { protected RouterFunctionMapping createRouterFunctionMapping() {
return new RouterFunctionMapping(); return new RouterFunctionMapping();
@ -289,7 +289,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
} }
/** /**
* Override to plug a sub-class of {@link RequestMappingHandlerAdapter}. * Override to plug a subclass of {@link RequestMappingHandlerAdapter}.
*/ */
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() { protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
return new RequestMappingHandlerAdapter(); return new RequestMappingHandlerAdapter();
@ -314,7 +314,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
} }
/** /**
* Override to plug a sub-class of {@link LocaleContextResolver}. * Override to plug a subclass of {@link LocaleContextResolver}.
*/ */
protected LocaleContextResolver createLocaleContextResolver() { protected LocaleContextResolver createLocaleContextResolver() {
return new AcceptHeaderLocaleContextResolver(); return new AcceptHeaderLocaleContextResolver();

View File

@ -54,7 +54,7 @@ public interface WebFluxConfigurer {
} }
/** /**
* Configure "global" cross origin request processing. The configured CORS * Configure "global" cross-origin request processing. The configured CORS
* mappings apply to annotated controllers, functional endpoints, and static * mappings apply to annotated controllers, functional endpoints, and static
* resources. * resources.
* <p>Annotated controllers can further declare more fine-grained config via * <p>Annotated controllers can further declare more fine-grained config via

View File

@ -230,7 +230,7 @@ public abstract class BodyExtractors {
Flux<T> result; Flux<T> result;
if (message.getHeaders().getContentType() == null) { if (message.getHeaders().getContentType() == null) {
// Maybe it's okay there is no content type, if there is no content.. // Maybe it's okay there is no content type, if there is no content.
result = message.getBody().map(buffer -> { result = message.getBody().map(buffer -> {
DataBufferUtils.release(buffer); DataBufferUtils.release(buffer);
throw ex; throw ex;

View File

@ -524,7 +524,7 @@ public class WebClientResponseException extends WebClientException {
} }
/** /**
* {@link WebClientResponseException} for status HTTP HTTP 502 Bad Gateway. * {@link WebClientResponseException} for HTTP status 502 Bad Gateway.
* @since 5.1 * @since 5.1
*/ */
@SuppressWarnings("serial") @SuppressWarnings("serial")

View File

@ -337,14 +337,14 @@ public abstract class RequestPredicates {
void method(Set<HttpMethod> methods); void method(Set<HttpMethod> methods);
/** /**
* Receive notification of an path predicate. * Receive notification of a path predicate.
* @param pattern the path pattern that makes up the predicate * @param pattern the path pattern that makes up the predicate
* @see RequestPredicates#path(String) * @see RequestPredicates#path(String)
*/ */
void path(String pattern); void path(String pattern);
/** /**
* Receive notification of an path extension predicate. * Receive notification of a path extension predicate.
* @param extension the path extension that makes up the predicate * @param extension the path extension that makes up the predicate
* @see RequestPredicates#pathExtension(String) * @see RequestPredicates#pathExtension(String)
*/ */

View File

@ -205,7 +205,7 @@ public abstract class RouterFunctions {
* for additional filter and exception handler registration through * for additional filter and exception handler registration through
* {@link WebHttpHandlerBuilder}. * {@link WebHttpHandlerBuilder}.
* @param routerFunction the router function to convert * @param routerFunction the router function to convert
* @return an http handler that handles HTTP request using the given router function * @return an HTTP handler that handles HTTP request using the given router function
*/ */
public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction) { public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction) {
return toHttpHandler(routerFunction, HandlerStrategies.withDefaults()); return toHttpHandler(routerFunction, HandlerStrategies.withDefaults());
@ -225,7 +225,7 @@ public abstract class RouterFunctions {
* </ul> * </ul>
* @param routerFunction the router function to convert * @param routerFunction the router function to convert
* @param strategies the strategies to use * @param strategies the strategies to use
* @return an http handler that handles HTTP request using the given router function * @return an HTTP handler that handles HTTP request using the given router function
*/ */
public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies) { public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies) {
WebHandler webHandler = toWebHandler(routerFunction, strategies); WebHandler webHandler = toWebHandler(routerFunction, strategies);

View File

@ -318,7 +318,7 @@ public interface ServerRequest {
* also with conditional POST/PUT/DELETE requests. * also with conditional POST/PUT/DELETE requests.
* <p><strong>Note:</strong> you can use either * <p><strong>Note:</strong> you can use either
* this {@code #checkNotModified(Instant)} method; or * this {@code #checkNotModified(Instant)} method; or
* {@link #checkNotModified(String)}. If you want enforce both * {@link #checkNotModified(String)}. If you want to enforce both
* a strong entity tag and a Last-Modified value, * a strong entity tag and a Last-Modified value,
* as recommended by the HTTP specification, * as recommended by the HTTP specification,
* then you should use {@link #checkNotModified(Instant, String)}. * then you should use {@link #checkNotModified(Instant, String)}.

View File

@ -106,7 +106,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
/** /**
* Return the {@link PathPatternParser} instance that is used for * Return the {@link PathPatternParser} instance that is used for
* {@link #setCorsConfigurations(Map) CORS configuration checks}. * {@link #setCorsConfigurations(Map) CORS configuration checks}.
* Sub-classes can also use this pattern parser for their own request * Subclasses can also use this pattern parser for their own request
* mapping purposes. * mapping purposes.
*/ */
public PathPatternParser getPathPatternParser() { public PathPatternParser getPathPatternParser() {
@ -114,7 +114,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
} }
/** /**
* Set the "global" CORS configurations based on URL patterns. By default the * Set the "global" CORS configurations based on URL patterns. By default, the
* first matching URL pattern is combined with handler-level CORS configuration if any. * first matching URL pattern is combined with handler-level CORS configuration if any.
* @see #setCorsConfigurationSource(CorsConfigurationSource) * @see #setCorsConfigurationSource(CorsConfigurationSource)
*/ */
@ -131,7 +131,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
} }
/** /**
* Set the "global" CORS configuration source. By default the first matching URL * Set the "global" CORS configuration source. By default, the first matching URL
* pattern is combined with the CORS configuration for the handler, if any. * pattern is combined with the CORS configuration for the handler, if any.
* @since 5.1 * @since 5.1
* @see #setCorsConfigurations(Map) * @see #setCorsConfigurations(Map)

View File

@ -78,7 +78,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping {
/** /**
* Return a read-only view of registered path patterns and handlers which may * Return a read-only view of registered path patterns and handlers which may
* may be an actual handler instance or the bean name of lazily initialized * be an actual handler instance or the bean name of lazily initialized
* handler. * handler.
*/ */
public final Map<PathPattern, Object> getHandlerMap() { public final Map<PathPattern, Object> getHandlerMap() {

View File

@ -113,7 +113,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
} }
/** /**
* Allow Map access to the URL path mappings, with the option to add or * Allow {@code Map} access to the URL path mappings, with the option to add or
* override specific entries. * override specific entries.
* <p>Useful for specifying entries directly, for example via "urlMap[myKey]". * <p>Useful for specifying entries directly, for example via "urlMap[myKey]".
* This is particularly useful for adding or overriding entries in child * This is particularly useful for adding or overriding entries in child

View File

@ -27,7 +27,7 @@ import org.springframework.util.DigestUtils;
import org.springframework.util.StreamUtils; import org.springframework.util.StreamUtils;
/** /**
* A {@code VersionStrategy} that calculates an Hex MD5 hashes from the content * A {@code VersionStrategy} that calculates a Hex MD5 hash from the content
* of the resource and appends it to the file name, e.g. * of the resource and appends it to the file name, e.g.
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}. * {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
* *

View File

@ -52,7 +52,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
/** /**
* By default when a Resource is found, the path of the resolved resource is * By default, when a Resource is found, the path of the resolved resource is
* compared to ensure it's under the input location where it was found. * compared to ensure it's under the input location where it was found.
* However sometimes that may not be the case, e.g. when * However sometimes that may not be the case, e.g. when
* {@link CssLinkResourceTransformer} * {@link CssLinkResourceTransformer}
@ -146,7 +146,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
/** /**
* Perform additional checks on a resolved resource beyond checking whether the * Perform additional checks on a resolved resource beyond checking whether the
* resources exists and is readable. The default implementation also verifies * resource exists and is readable. The default implementation also verifies
* the resource is either under the location relative to which it was found or * the resource is either under the location relative to which it was found or
* is under one of the {@link #setAllowedLocations allowed locations}. * is under one of the {@link #setAllowedLocations allowed locations}.
* @param resource the resource to check * @param resource the resource to check

View File

@ -116,7 +116,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
* in Java config). * in Java config).
* <p>If not done already, variants of the given {@code pathPatterns}, prefixed with * <p>If not done already, variants of the given {@code pathPatterns}, prefixed with
* the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern * the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern
* will also cofigure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the * will also configure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
* {@code version} String given as an argument. * {@code version} String given as an argument.
* @param version a version string * @param version a version string
* @param pathPatterns one or more resource URL path patterns, * @param pathPatterns one or more resource URL path patterns,

View File

@ -88,7 +88,7 @@ public abstract class HandlerResultHandlerSupport implements Ordered {
/** /**
* Set the order for this result handler relative to others. * Set the order for this result handler relative to others.
* <p>By default set to {@link Ordered#LOWEST_PRECEDENCE}, however see * <p>By default set to {@link Ordered#LOWEST_PRECEDENCE}, however see
* Javadoc of sub-classes which may change this default. * Javadoc of subclasses which may change this default.
* @param order the order * @param order the order
*/ */
public void setOrder(int order) { public void setOrder(int order) {

View File

@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> { public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> {
/** /**
* Indicates whether this condition is empty, i.e. whether or not it * Indicates whether this condition is empty, i.e. whether it
* contains any discrete items. * contains any discrete items.
* @return {@code true} if empty; {@code false} otherwise * @return {@code true} if empty; {@code false} otherwise
*/ */

View File

@ -427,7 +427,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
* Provide the mapping for a handler method. A method for which no * Provide the mapping for a handler method. A method for which no
* mapping can be provided is not a handler method. * mapping can be provided is not a handler method.
* @param method the method to provide a mapping for * @param method the method to provide a mapping for
* @param handlerType the handler type, possibly a sub-type of the method's * @param handlerType the handler type, possibly a subtype of the method's
* declaring class * declaring class
* @return the mapping, or {@code null} if the method is not mapped * @return the mapping, or {@code null} if the method is not mapped
*/ */

View File

@ -82,7 +82,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
/** /**
* Configure the argument resolvers to use to use for resolving method * Configure the argument resolvers to use for resolving method
* argument values against a {@code ServerWebExchange}. * argument values against a {@code ServerWebExchange}.
*/ */
public void setArgumentResolvers(List<? extends HandlerMethodArgumentResolver> resolvers) { public void setArgumentResolvers(List<? extends HandlerMethodArgumentResolver> resolvers) {

View File

@ -226,7 +226,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
/** /**
* Whether there any partial matches. * Whether there are any partial matches.
*/ */
public boolean isEmpty() { public boolean isEmpty() {
return this.partialMatches.isEmpty(); return this.partialMatches.isEmpty();

View File

@ -56,7 +56,7 @@ public class SyncInvocableHandlerMethod extends HandlerMethod {
/** /**
* Configure the argument resolvers to use to use for resolving method * Configure the argument resolvers to use for resolving method
* argument values against a {@code ServerWebExchange}. * argument values against a {@code ServerWebExchange}.
*/ */
public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers) { public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers) {

View File

@ -199,7 +199,7 @@ public abstract class AbstractMessageReaderArgumentResolver extends HandlerMetho
} }
} }
// No compatible reader but body may be empty.. // No compatible reader but body may be empty.
HttpMethod method = request.getMethod(); HttpMethod method = request.getMethod();
if (contentType == null && SUPPORTED_METHODS.contains(method)) { if (contentType == null && SUPPORTED_METHODS.contains(method)) {

View File

@ -28,7 +28,7 @@ import org.springframework.web.server.ServerWebExchange;
/** /**
* An extension of {@link AbstractNamedValueArgumentResolver} for named value * An extension of {@link AbstractNamedValueArgumentResolver} for named value
* resolvers that are synchronous and yet non-blocking. Sub-classes implement * resolvers that are synchronous and yet non-blocking. Subclasses implement
* the synchronous {@link #resolveNamedValue} to which the asynchronous * the synchronous {@link #resolveNamedValue} to which the asynchronous
* {@link #resolveName} delegates to by default. * {@link #resolveName} delegates to by default.
* *

View File

@ -39,7 +39,7 @@ import org.springframework.web.server.ServerWebInputException;
/** /**
* Resolves arguments annotated with {@link MatrixVariable @MatrixVariable}. * Resolves arguments annotated with {@link MatrixVariable @MatrixVariable}.
* *
* <p>If the method parameter is of type {@link Map} it will by resolved by * <p>If the method parameter is of type {@link Map} it will be resolved by
* {@link MatrixVariableMapMethodArgumentResolver} instead unless the annotation * {@link MatrixVariableMapMethodArgumentResolver} instead unless the annotation
* specifies a name in which case it is considered to be a single attribute of * specifies a name in which case it is considered to be a single attribute of
* type map (vs multiple attributes collected in a map). * type map (vs multiple attributes collected in a map).

View File

@ -30,7 +30,7 @@ import org.springframework.web.server.ServerWebExchange;
* Resolver for a controller method argument of type {@link Model} that can * Resolver for a controller method argument of type {@link Model} that can
* also be resolved as a {@link java.util.Map}. * also be resolved as a {@link java.util.Map}.
* *
* <p>A Map return value can be interpreted in more than one ways depending * <p>A Map return value can be interpreted in more than one way depending
* on the presence of annotations like {@code @ModelAttribute} or * on the presence of annotations like {@code @ModelAttribute} or
* {@code @ResponseBody}. As of 5.2 this resolver returns false if a * {@code @ResponseBody}. As of 5.2 this resolver returns false if a
* parameter of type {@code Map} is also annotated. * parameter of type {@code Map} is also annotated.

View File

@ -298,10 +298,10 @@ public class RedirectView extends AbstractUrlBasedView {
/** /**
* Whether the given targetUrl has a host that is a "foreign" system in which * Whether the given targetUrl has a host that is a "foreign" system in which
* case {@link jakarta.servlet.http.HttpServletResponse#encodeRedirectURL} will not be applied. * case {@link jakarta.servlet.http.HttpServletResponse#encodeRedirectURL} will not be applied.
* This method returns {@code true} if the {@link #setHosts(String[])} * <p>This method returns {@code true} if the {@link #setHosts(String[])}
* property is configured and the target URL has a host that does not match. * property is configured and the target URL has a host that does not match.
* @param targetUrl the target redirect URL * @param targetUrl the target redirect URL
* @return {@code true} the target URL has a remote host, {@code false} if it * @return {@code true} if the target URL has a remote host, {@code false} if
* the URL does not have a host or the "host" property is not configured * the URL does not have a host or the "host" property is not configured
*/ */
protected boolean isRemoteHost(String targetUrl) { protected boolean isRemoteHost(String targetUrl) {

View File

@ -247,7 +247,7 @@ public class UrlBasedViewResolver extends ViewResolverSupport
} }
/** /**
* Indicates whether or not this {@link ViewResolver} can handle the supplied * Indicates whether this {@link ViewResolver} can handle the supplied
* view name. If not, an empty result is returned. The default implementation * view name. If not, an empty result is returned. The default implementation
* checks against the configured {@link #setViewNames view names}. * checks against the configured {@link #setViewNames view names}.
* @param viewName the name of the view to retrieve * @param viewName the name of the view to retrieve

View File

@ -64,7 +64,7 @@ public interface View {
} }
/** /**
* Whether this View does rendering by performing a redirect. * Whether this View does render by performing a redirect.
*/ */
default boolean isRedirectView() { default boolean isRedirectView() {
return false; return false;

View File

@ -331,7 +331,7 @@ public abstract class AbstractListenerWebSocketSession<T> extends AbstractWebSoc
} }
/** /**
* Sub-classes can invoke this before sending a message (false) and * Subclasses can invoke this before sending a message (false) and
* after receiving the async send callback (true) effective translating * after receiving the async send callback (true) effective translating
* async completion callback into simple flow control. * async completion callback into simple flow control.
*/ */

View File

@ -290,7 +290,7 @@ public class DefaultWebClientTests {
.defaultCookie("baz", "qux") .defaultCookie("baz", "qux")
.build(); .build();
// Now, verify what each client has.. // Now, verify what each client has.
WebClient.Builder builder1 = client1.mutate(); WebClient.Builder builder1 = client1.mutate();
builder1.filters(filters -> assertThat(filters.size()).isEqualTo(1)); builder1.filters(filters -> assertThat(filters.size()).isEqualTo(1));

View File

@ -44,7 +44,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.PUT;
*/ */
public class RequestMethodsRequestConditionTests { public class RequestMethodsRequestConditionTests {
// TODO: custom method, CORS pre-flight (see @Disabledd) // TODO: custom method, CORS pre-flight (see @Disabled)
@Test @Test
public void getMatchingCondition() throws Exception { public void getMatchingCondition() throws Exception {

View File

@ -167,7 +167,7 @@ public class RequestMappingMessageConversionIntegrationTests extends AbstractReq
assertThat(responseEntity.getBody()).isNull(); assertThat(responseEntity.getBody()).isNull();
// As we're on the same connection, the 2nd request proves server response handling // As we're on the same connection, the 2nd request proves server response handling
// did complete after the 1st request.. // did complete after the 1st request.
responseEntity = performGet("/person-response/mono-empty", JSON, Person.class); responseEntity = performGet("/person-response/mono-empty", JSON, Person.class);
assertThat(responseEntity.getHeaders().getContentLength()).isEqualTo(0); assertThat(responseEntity.getHeaders().getContentLength()).isEqualTo(0);
assertThat(responseEntity.getBody()).isNull(); assertThat(responseEntity.getBody()).isNull();

View File

@ -67,7 +67,7 @@ import org.springframework.web.testfixture.http.server.reactive.bootstrap.Tomcat
import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer; import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer;
/** /**
* Base class for WebSocket integration tests. Sub-classes must implement * Base class for WebSocket integration tests. Subclasses must implement
* {@link #getWebConfigClass()} to return Spring config class with (server-side) * {@link #getWebConfigClass()} to return Spring config class with (server-side)
* handler mappings to {@code WebSocketHandler}'s. * handler mappings to {@code WebSocketHandler}'s.
* *