Skip to content

Commit

Permalink
Fix and improve Javadoc in spring-webflux
Browse files Browse the repository at this point in the history
Closes gh-28790
  • Loading branch information
marcwrobel authored and sbrannen committed Jul 12, 2022
1 parent 5b1a84e commit 31c6965
Show file tree
Hide file tree
Showing 34 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface HandlerAdapter {
/**
* Whether this {@code HandlerAdapter} supports the given {@code handler}.
* @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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface HandlerResultHandler {
/**
* Whether this handler supports the given {@link HandlerResult}.
* @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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
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
* {@link MediaTypeFactory} can be used to perform a lookup.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ private void configureAbstractHandlerMapping(AbstractHandlerMapping mapping, Pat
}

/**
* Override to plug a sub-class of {@link RequestMappingHandlerMapping}.
* Override to plug a subclass of {@link RequestMappingHandlerMapping}.
*/
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
return new RequestMappingHandlerMapping();
Expand All @@ -176,7 +176,7 @@ protected void configureContentTypeResolver(RequestedContentTypeResolverBuilder

/**
* 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() {
if (this.corsConfigurations == null) {
Expand All @@ -188,7 +188,7 @@ protected final Map<String, CorsConfiguration> getCorsConfigurations() {
}

/**
* Override this method to configure cross origin requests processing.
* Override this method to configure cross-origin requests processing.
* @see CorsRegistry
*/
protected void addCorsMappings(CorsRegistry registry) {
Expand Down Expand Up @@ -222,7 +222,7 @@ public RouterFunctionMapping routerFunctionMapping(ServerCodecConfigurer serverC
}

/**
* Override to plug a sub-class of {@link RouterFunctionMapping}.
* Override to plug a subclass of {@link RouterFunctionMapping}.
*/
protected RouterFunctionMapping createRouterFunctionMapping() {
return new RouterFunctionMapping();
Expand Down Expand Up @@ -285,7 +285,7 @@ public RequestMappingHandlerAdapter requestMappingHandlerAdapter(
}

/**
* Override to plug a sub-class of {@link RequestMappingHandlerAdapter}.
* Override to plug a subclass of {@link RequestMappingHandlerAdapter}.
*/
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
return new RequestMappingHandlerAdapter();
Expand All @@ -310,7 +310,7 @@ public ServerCodecConfigurer serverCodecConfigurer() {
}

/**
* Override to plug a sub-class of {@link LocaleContextResolver}.
* Override to plug a subclass of {@link LocaleContextResolver}.
*/
protected LocaleContextResolver createLocaleContextResolver() {
return new AcceptHeaderLocaleContextResolver();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ default void configureContentTypeResolver(RequestedContentTypeResolverBuilder bu
}

/**
* 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
* resources.
* <p>Annotated controllers can further declare more fine-grained config via
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private static <T> Flux<T> unsupportedErrorHandler(

Flux<T> result;
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 -> {
DataBufferUtils.release(buffer);
throw ex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public static class NotImplemented extends WebClientResponseException {
}

/**
* {@link WebClientResponseException} for status HTTP HTTP 502 Bad Gateway.
* {@link WebClientResponseException} for HTTP status 502 Bad Gateway.
* @since 5.1
*/
@SuppressWarnings("serial")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ public interface Visitor {
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
* @see RequestPredicates#path(String)
*/
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
* @see RequestPredicates#pathExtension(String)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static RouterFunction<ServerResponse> resources(Function<ServerRequest, M
* for additional filter and exception handler registration through
* {@link WebHttpHandlerBuilder}.
* @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) {
return toHttpHandler(routerFunction, HandlerStrategies.withDefaults());
Expand All @@ -225,7 +225,7 @@ public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction) {
* </ul>
* @param routerFunction the router function to convert
* @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) {
WebHandler webHandler = toWebHandler(routerFunction, strategies);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ default String pathVariable(String name) {
* also with conditional POST/PUT/DELETE requests.
* <p><strong>Note:</strong> you can use either
* 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,
* as recommended by the HTTP specification,
* then you should use {@link #checkNotModified(Instant, String)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ public void setUseTrailingSlashMatch(boolean trailingSlashMatch) {
/**
* Return the {@link PathPatternParser} instance that is used for
* {@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.
*/
public PathPatternParser getPathPatternParser() {
return this.patternParser;
}

/**
* 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.
* @see #setCorsConfigurationSource(CorsConfigurationSource)
*/
Expand All @@ -131,7 +131,7 @@ public void setCorsConfigurations(Map<String, CorsConfiguration> corsConfigurati
}

/**
* 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.
* @since 5.1
* @see #setCorsConfigurations(Map)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setLazyInitHandlers(boolean lazyInitHandlers) {

/**
* 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.
*/
public final Map<PathPattern, Object> getHandlerMap() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void setUrlMap(Map<String, ?> urlMap) {
}

/**
* 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.
* <p>Useful for specifying entries directly, for example via "urlMap[myKey]".
* This is particularly useful for adding or overriding entries in child
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
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.
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* However sometimes that may not be the case, e.g. when
* {@link CssLinkResourceTransformer}
Expand Down Expand Up @@ -146,7 +146,7 @@ else if (logger.isWarnEnabled()) {

/**
* Perform additional checks on a resolved resource beyond checking whether the
* resources exists and is readable. The default implementation also verifies
* resources exist and is readable. The default implementation also verifies
* the resource is either under the location relative to which it was found or
* is under one of the {@link #setAllowedLocations allowed locations}.
* @param resource the resource to check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public VersionResourceResolver addContentVersionStrategy(String... pathPatterns)
* in Java config).
* <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
* 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.
* @param version a version string
* @param pathPatterns one or more resource URL path patterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public RequestedContentTypeResolver getContentTypeResolver() {
/**
* Set the order for this result handler relative to others.
* <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
*/
public void setOrder(int order) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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.
* @return {@code true} if empty; {@code false} otherwise
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ protected CorsConfiguration getCorsConfiguration(Object handler, ServerWebExchan
* Provide the mapping for a handler method. A method for which no
* mapping can be provided is not a handler method.
* @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
* @return the mapping, or {@code null} if the method is not mapped
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public InvocableHandlerMethod(Object bean, Method method) {


/**
* 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}.
*/
public void setArgumentResolvers(List<? extends HandlerMethodArgumentResolver> resolvers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public PartialMatchHelper(Set<RequestMappingInfo> infos, ServerWebExchange excha


/**
* Whether there any partial matches.
* Whether there is any partial matches.
*/
public boolean isEmpty() {
return this.partialMatches.isEmpty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public SyncInvocableHandlerMethod(Object bean, Method method) {


/**
* 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}.
*/
public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ protected Mono<Object> readBody(MethodParameter bodyParam, @Nullable MethodParam
}
}

// No compatible reader but body may be empty..
// No compatible reader but body may be empty.

HttpMethod method = request.getMethod();
if (contentType == null && method != null && SUPPORTED_METHODS.contains(method)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

/**
* 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
* {@link #resolveName} delegates to by default.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/**
* 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
* specifies a name in which case it is considered to be a single attribute of
* type map (vs multiple attributes collected in a map).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Resolver for a controller method argument of type {@link Model} that can
* 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
* {@code @ResponseBody}. As of 5.2 this resolver returns false if a
* parameter of type {@code Map} is also annotated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ protected Mono<Void> sendRedirect(String targetUrl, ServerWebExchange exchange)
* This method returns {@code true} if the {@link #setHosts(String[])}
* property is configured and the target URL has a host that does not match.
* @param targetUrl the target redirect URL
* @return {@code true} the target URL has a remote host, {@code false} if it
* @return {@code true} the target URL has a remote host, {@code false} if
* the URL does not have a host or the "host" property is not configured
*/
protected boolean isRemoteHost(String targetUrl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public Mono<View> resolveViewName(String viewName, Locale locale) {
}

/**
* 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
* checks against the configured {@link #setViewNames view names}.
* @param viewName the name of the view to retrieve
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ default List<MediaType> getSupportedMediaTypes() {
}

/**
* Whether this View does rendering by performing a redirect.
* Whether this View does render by performing a redirect.
*/
default boolean isRedirectView() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ protected boolean isWritePossible() {
}

/**
* 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
* async completion callback into simple flow control.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ public void mutateDoesCopy() {
.defaultCookie("baz", "qux")
.build();

// Now, verify what each client has..
// Now, verify what each client has.

WebClient.Builder builder1 = client1.mutate();
builder1.filters(filters -> assertThat(filters.size()).isEqualTo(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
public class RequestMethodsRequestConditionTests {

// TODO: custom method, CORS pre-flight (see @Disabledd)
// TODO: custom method, CORS pre-flight (see @Disabled)

@Test
public void getMatchingCondition() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void personResponseBodyWithEmptyMono(HttpServer httpServer) throws Except
assertThat(responseEntity.getBody()).isNull();

// 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);
assertThat(responseEntity.getHeaders().getContentLength()).isEqualTo(0);
assertThat(responseEntity.getBody()).isNull();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
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)
* handler mappings to {@code WebSocketHandler}'s.
*
Expand Down

0 comments on commit 31c6965

Please sign in to comment.