From 92228f9e64adf66e375ac90cbf458abe7ef86214 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 16 Aug 2018 19:24:38 +0200 Subject: [PATCH] Fix recent javadoc errors Issue: SPR-17174 --- .../support/ResourceBundleMessageSource.java | 6 ++-- .../tcp/reactor/ReactorNettyTcpClient.java | 18 ++++------- .../web/reactive/server/WebTestClient.java | 21 +++++++++--- .../OkHttp3ClientHttpRequestFactory.java | 9 ++---- .../reactive/ReactorClientHttpConnector.java | 4 +-- ...rotobufJsonFormatHttpMessageConverter.java | 10 +++--- .../http/server/reactive/HttpHandler.java | 10 +++--- .../client/DefaultResponseErrorHandler.java | 7 ++-- .../ExtractingResponseErrorHandler.java | 16 +++++----- .../web/client/RestOperations.java | 4 +-- .../web/client/RestTemplate.java | 32 +++++++++++-------- .../function/server/ServerRequest.java | 10 +++--- .../client/ReactorNettyWebSocketClient.java | 4 +-- .../client/UndertowWebSocketClient.java | 20 ++++++------ .../TransportHandlingSockJsService.java | 4 +-- 15 files changed, 91 insertions(+), 84 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java index 265c87583b1..dd9a0081df8 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java +++ b/spring-context/src/main/java/org/springframework/context/support/ResourceBundleMessageSource.java @@ -347,9 +347,9 @@ public class ResourceBundleMessageSource extends AbstractResourceBasedMessageSou /** - * Custom implementation of Java 6's {@code ResourceBundle.Control}, - * adding support for custom file encodings, deactivating the fallback to the - * system locale and activating ResourceBundle's native cache, if desired. + * Custom implementation of {@code ResourceBundle.Control}, adding support + * for custom file encodings, deactivating the fallback to the system locale + * and activating ResourceBundle's native cache, if desired. */ private class MessageSourceControl extends ResourceBundle.Control { diff --git a/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java b/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java index 83cce81f0d8..e645967de7d 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/tcp/reactor/ReactorNettyTcpClient.java @@ -102,27 +102,24 @@ public class ReactorNettyTcpClient

implements TcpOperations

{ } /** - * Constructor with a {@link ClientOptions.Builder} that can be used to + * Constructor with a {@code ClientOptions.Builder} that can be used to * customize Reactor Netty client options. - * *

Note: this constructor manages the lifecycle of the * {@link TcpClient} and its underlying resources. Please do not customize * any of the following options: - * {@link ClientOptions.Builder#channelGroup(ChannelGroup) ChannelGroup}, - * {@link ClientOptions.Builder#loopResources(LoopResources) LoopResources}, and - * {@link ClientOptions.Builder#poolResources(PoolResources) PoolResources}. - * You may set the {@link ClientOptions.Builder#disablePool() disablePool} + * {@code ClientOptions.Builder#channelGroup(ChannelGroup) ChannelGroup}, + * {@code ClientOptions.Builder#loopResources(LoopResources) LoopResources}, and + * {@code ClientOptions.Builder#poolResources(PoolResources) PoolResources}. + * You may set the {@code ClientOptions.Builder#disablePool() disablePool} * option if you simply want to turn off pooling. - * *

For full control over the initialization and lifecycle of the TcpClient, * see {@link #ReactorNettyTcpClient(TcpClient, ReactorNettyCodec)}. - * * @param optionsConsumer consumer to customize client options * @param codec the code to use * @see org.springframework.messaging.simp.stomp.StompReactorNettyCodec */ - public ReactorNettyTcpClient(Consumer> optionsConsumer, - ReactorNettyCodec

codec) { + public ReactorNettyTcpClient( + Consumer> optionsConsumer, ReactorNettyCodec

codec) { Assert.notNull(optionsConsumer, "Consumer is required"); Assert.notNull(codec, "ReactorNettyCodec is required"); @@ -155,7 +152,6 @@ public class ReactorNettyTcpClient

implements TcpOperations

{ /** * Constructor with an externally created {@link TcpClient} instance whose * lifecycle is expected to be managed externally. - * * @param tcpClient the TcpClient instance to use * @param codec the code to use * @see org.springframework.messaging.simp.stomp.StompReactorNettyCodec diff --git a/spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java b/spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java index 06ccaa89a25..dd79d43048d 100644 --- a/spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java +++ b/spring-test/src/main/java/org/springframework/test/web/reactive/server/WebTestClient.java @@ -359,8 +359,10 @@ public interface WebTestClient { /** - * Steps for customizing the {@link WebClient} used to test with - * internally delegating to a {@link WebClient.Builder}. + * Steps for customizing the {@link WebClient} used to test with, + * internally delegating to a + * {@link org.springframework.web.reactive.function.client.WebClient.Builder + * WebClient.Builder}. */ interface Builder { @@ -443,7 +445,8 @@ public interface WebTestClient { Builder responseTimeout(Duration timeout); /** - * Shortcut for pre-packaged customizations to WebTestClient builder. + * Apply the given configurer to this builder instance. + *

This can be useful for applying pre-packaged customizations. * @param configurer the configurer to apply */ Builder apply(WebTestClientConfigurer configurer); @@ -591,6 +594,9 @@ public interface WebTestClient { } + /** + * Specification for providing body of a request. + */ interface RequestBodySpec extends RequestHeadersSpec { /** * Set the length of the body in bytes, as specified by the @@ -649,10 +655,15 @@ public interface WebTestClient { } + /** + * Specification for providing request headers and the URI of a request. + */ interface RequestHeadersUriSpec> extends UriSpec, RequestHeadersSpec { } - + /** + * Specification for providing the body and the URI of a request. + */ interface RequestBodyUriSpec extends RequestBodySpec, RequestHeadersUriSpec { } @@ -792,7 +803,7 @@ public interface WebTestClient { * Parse the expected and actual response content as JSON and perform a * "lenient" comparison verifying the same attribute-value pairs. *

Use of this option requires the - * JSONassert library + * JSONassert library * on to be on the classpath. * @param expectedJson the expected JSON content. */ diff --git a/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java b/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java index 894a3f675b5..0eabe44545d 100644 --- a/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java +++ b/spring-web/src/main/java/org/springframework/http/client/OkHttp3ClientHttpRequestFactory.java @@ -71,9 +71,8 @@ public class OkHttp3ClientHttpRequestFactory /** - * Sets the underlying read timeout in milliseconds. + * Set the underlying read timeout in milliseconds. * A value of 0 specifies an infinite timeout. - * @see OkHttpClient.Builder#readTimeout(long, TimeUnit) */ public void setReadTimeout(int readTimeout) { this.client = this.client.newBuilder() @@ -82,9 +81,8 @@ public class OkHttp3ClientHttpRequestFactory } /** - * Sets the underlying write timeout in milliseconds. + * Set the underlying write timeout in milliseconds. * A value of 0 specifies an infinite timeout. - * @see OkHttpClient.Builder#writeTimeout(long, TimeUnit) */ public void setWriteTimeout(int writeTimeout) { this.client = this.client.newBuilder() @@ -93,9 +91,8 @@ public class OkHttp3ClientHttpRequestFactory } /** - * Sets the underlying connect timeout in milliseconds. + * Set the underlying connect timeout in milliseconds. * A value of 0 specifies an infinite timeout. - * @see OkHttpClient.Builder#connectTimeout(long, TimeUnit) */ public void setConnectTimeout(int connectTimeout) { this.client = this.client.newBuilder() diff --git a/spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java b/spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java index 2ee616b1fac..56a59bbf960 100644 --- a/spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java +++ b/spring-web/src/main/java/org/springframework/http/client/reactive/ReactorClientHttpConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ public class ReactorClientHttpConnector implements ClientHttpConnector { /** * Create a Reactor Netty {@link ClientHttpConnector} with the given - * {@link HttpClientOptions.Builder} + * {@code HttpClientOptions.Builder} */ public ReactorClientHttpConnector(Consumer clientOptions) { this.httpClient = HttpClient.create(clientOptions); diff --git a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufJsonFormatHttpMessageConverter.java b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufJsonFormatHttpMessageConverter.java index 9338c8971a5..21e75cb2c40 100644 --- a/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufJsonFormatHttpMessageConverter.java +++ b/spring-web/src/main/java/org/springframework/http/converter/protobuf/ProtobufJsonFormatHttpMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public class ProtobufJsonFormatHttpMessageConverter extends ProtobufHttpMessageC /** * Construct a new {@code ProtobufJsonFormatHttpMessageConverter} with default - * {@link JsonFormat.Parser} and {@link JsonFormat.Printer} configuration. + * {@code JsonFormat.Parser} and {@code JsonFormat.Printer} configuration. */ public ProtobufJsonFormatHttpMessageConverter() { this(null, null, null); @@ -49,7 +49,7 @@ public class ProtobufJsonFormatHttpMessageConverter extends ProtobufHttpMessageC /** * Construct a new {@code ProtobufJsonFormatHttpMessageConverter} with the given - * {@link JsonFormat.Parser} and {@link JsonFormat.Printer} configuration. + * {@code JsonFormat.Parser} and {@code JsonFormat.Printer} configuration. * @param parser the JSON parser configuration * @param printer the JSON printer configuration */ @@ -61,8 +61,8 @@ public class ProtobufJsonFormatHttpMessageConverter extends ProtobufHttpMessageC /** * Construct a new {@code ProtobufJsonFormatHttpMessageConverter} with the given - * {@link JsonFormat.Parser} and {@link JsonFormat.Printer} configuration, also - * accepting an initializer that allows the registration of message extensions + * {@code JsonFormat.Parser} and {@code JsonFormat.Printer} configuration, also + * accepting an initializer that allows the registration of message extensions. * @param parser the JSON parser configuration * @param printer the JSON printer configuration * @param registryInitializer an initializer for message extensions diff --git a/spring-web/src/main/java/org/springframework/http/server/reactive/HttpHandler.java b/spring-web/src/main/java/org/springframework/http/server/reactive/HttpHandler.java index 5683a7d630b..18916d55fb1 100644 --- a/spring-web/src/main/java/org/springframework/http/server/reactive/HttpHandler.java +++ b/spring-web/src/main/java/org/springframework/http/server/reactive/HttpHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,16 +24,16 @@ import reactor.core.publisher.Mono; * *

Higher-level, but still generic, building blocks for applications such as * {@code WebFilter}, {@code WebSession}, {@code ServerWebExchange}, and others - * are available in the {@link org.springframework.web.server} package. + * are available in the {@code org.springframework.web.server} package. * *

Application level programming models such as annotated controllers and * functional handlers are available in the {@code spring-webflux} module. * *

Typically an {@link HttpHandler} represents an entire application with * higher-level programming models bridged via - * {@link org.springframework.web.server.adapter.WebHttpHandlerBuilder - * WebHttpHandlerBuilder}. Multiple applications at unique context paths can be - * plugged in with the help of the {@link ContextPathCompositeHandler}. + * {@link org.springframework.web.server.adapter.WebHttpHandlerBuilder}. + * Multiple applications at unique context paths can be plugged in with the + * help of the {@link ContextPathCompositeHandler}. * * @author Arjen Poutsma * @author Rossen Stoyanchev diff --git a/spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java b/spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java index e545f978e4e..fd6d84354b8 100644 --- a/spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java +++ b/spring-web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,8 +55,8 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler { /** * Template method called from {@link #hasError(ClientHttpResponse)}. *

The default implementation checks if the given status code is - * {@link HttpStatus.Series#CLIENT_ERROR CLIENT_ERROR} or - * {@link HttpStatus.Series#SERVER_ERROR SERVER_ERROR}. + * {@code HttpStatus.Series#CLIENT_ERROR CLIENT_ERROR} or + * {@code HttpStatus.Series#SERVER_ERROR SERVER_ERROR}. * Can be overridden in subclasses. * @param statusCode the HTTP status code * @return {@code true} if the response has an error; {@code false} otherwise @@ -101,7 +101,6 @@ public class DefaultResponseErrorHandler implements ResponseErrorHandler { } } - /** * Determine the HTTP status of the given response. * @param response the response to inspect diff --git a/spring-web/src/main/java/org/springframework/web/client/ExtractingResponseErrorHandler.java b/spring-web/src/main/java/org/springframework/web/client/ExtractingResponseErrorHandler.java index 73ab71a5b57..a4c9a4e58de 100644 --- a/spring-web/src/main/java/org/springframework/web/client/ExtractingResponseErrorHandler.java +++ b/spring-web/src/main/java/org/springframework/web/client/ExtractingResponseErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,25 +29,25 @@ import org.springframework.lang.Nullable; import org.springframework.util.CollectionUtils; /** - * Implementation of {@link ResponseErrorHandler} that uses {@link HttpMessageConverter}s to - * convert HTTP error responses to {@link RestClientException}. + * Implementation of {@link ResponseErrorHandler} that uses {@link HttpMessageConverter}s + * to convert HTTP error responses to {@link RestClientException}. * *

To use this error handler, you must specify a * {@linkplain #setStatusMapping(Map) status mapping} and/or a * {@linkplain #setSeriesMapping(Map) series mapping}. If either of these mappings has a match * for the {@linkplain ClientHttpResponse#getStatusCode() status code} of a given * {@code ClientHttpResponse}, {@link #hasError(ClientHttpResponse)} will return - * {@code true} and {@link #handleError(ClientHttpResponse)} will attempt to use the + * {@code true}, and {@link #handleError(ClientHttpResponse)} will attempt to use the * {@linkplain #setMessageConverters(List) configured message converters} to convert the response * into the mapped subclass of {@link RestClientException}. Note that the * {@linkplain #setStatusMapping(Map) status mapping} takes precedence over * {@linkplain #setSeriesMapping(Map) series mapping}. * *

If there is no match, this error handler will default to the behavior of - * {@link DefaultResponseErrorHandler}. Note that you can override this default behavior by - * specifying a {@linkplain #setSeriesMapping(Map) series mapping} from - * {@link HttpStatus.Series#CLIENT_ERROR} and/or {@link HttpStatus.Series#SERVER_ERROR} to - * {@code null}. + * {@link DefaultResponseErrorHandler}. Note that you can override this default behavior + * by specifying a {@linkplain #setSeriesMapping(Map) series mapping} from + * {@code HttpStatus.Series#CLIENT_ERROR} and/or {@code HttpStatus.Series#SERVER_ERROR} + * to {@code null}. * * @author Simon Galperin * @author Arjen Poutsma diff --git a/spring-web/src/main/java/org/springframework/web/client/RestOperations.java b/spring-web/src/main/java/org/springframework/web/client/RestOperations.java index afc9baa2032..4b6fed59ecb 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestOperations.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestOperations.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -657,7 +657,7 @@ public interface RestOperations { throws RestClientException; - // general execution + // General execution /** * Execute the HTTP method to the given URI template, preparing the request with the diff --git a/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java b/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java index 7315e3151fa..bc8b7141cc5 100644 --- a/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java +++ b/spring-web/src/main/java/org/springframework/web/client/RestTemplate.java @@ -69,11 +69,11 @@ import org.springframework.web.util.UriTemplateHandler; * support of less frequent cases. * *

NOTE: As of 5.0, the non-blocking, reactive - * {@link org.springframework.web.reactive.client.WebClient WebClient} offers a + * {@code org.springframework.web.reactive.client.WebClient} offers a * modern alternative to the {@code RestTemplate} with efficient support for * both sync and async, as well as streaming scenarios. The {@code RestTemplate} * will be deprecated in a future version and will not have major new features - * gong forward. + * added going forward. * * @author Arjen Poutsma * @author Brian Clozel @@ -174,7 +174,7 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat /** * Create a new instance of the {@link RestTemplate} based on the given {@link ClientHttpRequestFactory}. - * @param requestFactory HTTP request factory to use + * @param requestFactory the HTTP request factory to use * @see org.springframework.http.client.SimpleClientHttpRequestFactory * @see org.springframework.http.client.HttpComponentsClientHttpRequestFactory */ @@ -185,7 +185,7 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat /** * Create a new instance of the {@link RestTemplate} using the given list of - * {@link HttpMessageConverter} to use + * {@link HttpMessageConverter} to use. * @param messageConverters the list of {@link HttpMessageConverter} to use * @since 3.2.7 */ @@ -633,7 +633,7 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat } - // general execution + // General execution @Override @Nullable @@ -732,39 +732,43 @@ public class RestTemplate extends InterceptingHttpAccessor implements RestOperat } /** - * Returns a request callback implementation that prepares the request {@code Accept} - * headers based on the given response type and configured - * {@linkplain #getMessageConverters() message converters}. + * Return a {@code RequestCallback} that sets the request {@code Accept} + * header based on the given response type, cross-checked against the + * configured message converters. */ protected RequestCallback acceptHeaderRequestCallback(Class responseType) { return new AcceptHeaderRequestCallback(responseType); } /** - * Returns a request callback implementation that writes the given object to the - * request stream. + * Return a {@code RequestCallback} implementation that writes the given + * object to the request stream. */ protected RequestCallback httpEntityCallback(@Nullable Object requestBody) { return new HttpEntityRequestCallback(requestBody); } /** - * Returns a request callback implementation that writes the given object to the - * request stream. + * Return a {@code RequestCallback} implementation that: + *

    + *
  1. Sets the request {@code Accept} header based on the given response + * type, cross-checked against the configured message converters. + *
  2. Writes the given object to the request stream. + *
*/ protected RequestCallback httpEntityCallback(@Nullable Object requestBody, Type responseType) { return new HttpEntityRequestCallback(requestBody, responseType); } /** - * Returns a response extractor for {@link ResponseEntity}. + * Return a {@code ResponseExtractor} that prepares a {@link ResponseEntity}. */ protected ResponseExtractor> responseEntityExtractor(Type responseType) { return new ResponseEntityResponseExtractor<>(responseType); } /** - * Returns a response extractor for {@link HttpHeaders}. + * Return a response extractor for {@link HttpHeaders}. */ protected ResponseExtractor headersExtractor() { return this.headersExtractor; diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java index 7273f5bb53a..e220a03c0f7 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/ServerRequest.java @@ -264,7 +264,7 @@ public interface ServerRequest { Mono> multipartData(); - // Static methods + // Static builder methods /** * Create a new {@code ServerRequest} based on the given {@code ServerWebExchange} and @@ -285,20 +285,20 @@ public interface ServerRequest { interface Headers { /** - * Return the list of acceptable {@linkplain MediaType media types}, + * Return the list of acceptable {@code MediaType media types}, * as specified by the {@code Accept} header. *

Returns an empty list when the acceptable media types are unspecified. */ List accept(); /** - * Return the list of acceptable {@linkplain Charset charsets}, + * Return the list of acceptable {@code Charset charsets}, * as specified by the {@code Accept-Charset} header. */ List acceptCharset(); /** - * Return the list of acceptable {@linkplain Locale.LanguageRange languages}, + * Return the list of acceptable {@code Locale.LanguageRange languages}, * as specified by the {@code Accept-Language} header. */ List acceptLanguage(); @@ -310,7 +310,7 @@ public interface ServerRequest { OptionalLong contentLength(); /** - * Return the {@linkplain MediaType media type} of the body, as specified + * Return the {@code MediaType media type} of the body, as specified * by the {@code Content-Type} header. */ Optional contentType(); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/ReactorNettyWebSocketClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/ReactorNettyWebSocketClient.java index 42fa2ec8d1b..2afe641a725 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/ReactorNettyWebSocketClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/ReactorNettyWebSocketClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,7 +52,7 @@ public class ReactorNettyWebSocketClient extends WebSocketClientSupport implemen } /** - * Constructor that accepts an {@link HttpClientOptions.Builder} consumer + * Constructor that accepts an {@code HttpClientOptions.Builder} consumer * to supply to {@link HttpClient#create(Consumer)}. */ public ReactorNettyWebSocketClient(Consumer clientOptions) { diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/UndertowWebSocketClient.java b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/UndertowWebSocketClient.java index f8c08bb47f9..b3d11906f47 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/UndertowWebSocketClient.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/UndertowWebSocketClient.java @@ -66,7 +66,7 @@ public class UndertowWebSocketClient extends WebSocketClientSupport implements W /** * Constructor with the {@link XnioWorker} to pass to - * {@link io.undertow.websockets.client.WebSocketClient#connectionBuilder} + * {@link io.undertow.websockets.client.WebSocketClient#connectionBuilder}. * @param worker the Xnio worker */ public UndertowWebSocketClient(XnioWorker worker) { @@ -112,9 +112,10 @@ public class UndertowWebSocketClient extends WebSocketClientSupport implements W /** * Set the {@link io.undertow.connector.ByteBufferPool ByteBufferPool} to pass to * {@link io.undertow.websockets.client.WebSocketClient#connectionBuilder}. - *

By default an indirect {@link io.undertow.server.DefaultByteBufferPool} with a buffer size - * of {@value #DEFAULT_POOL_BUFFER_SIZE} is used. + *

By default an indirect {@link io.undertow.server.DefaultByteBufferPool} + * with a buffer size of 8192 is used. * @since 5.0.8 + * @see #DEFAULT_POOL_BUFFER_SIZE */ public void setByteBufferPool(ByteBufferPool byteBufferPool) { Assert.notNull(byteBufferPool, "ByteBufferPool must not be null"); @@ -122,8 +123,9 @@ public class UndertowWebSocketClient extends WebSocketClientSupport implements W } /** - * @return the {@link io.undertow.connector.ByteBufferPool} currently used - * for newly created WebSocket sessions by this client + * Return the {@link io.undertow.connector.ByteBufferPool} currently used + * for newly created WebSocket sessions by this client. + * @return the byte buffer pool * @since 5.0.8 */ public ByteBufferPool getByteBufferPool() { @@ -131,17 +133,15 @@ public class UndertowWebSocketClient extends WebSocketClientSupport implements W } /** - * Return the configured {@code ConsumerConsumer<ConnectionBuilder>. */ public Consumer getConnectionBuilderConsumer() { return this.builderConsumer; } /** - * Configure the size of the {@link io.undertow.connector.ByteBufferPool - * ByteBufferPool} to pass to - * {@link io.undertow.websockets.client.WebSocketClient#connectionBuilder}. - *

By default the buffer size is set to {@value #DEFAULT_POOL_BUFFER_SIZE}. + * Configure the size of the {@link io.undertow.connector.ByteBufferPool} to pass + * to {@link io.undertow.websockets.client.WebSocketClient#connectionBuilder}. * @deprecated as of 5.0.8 this method is deprecated in favor * of {@link #setByteBufferPool(io.undertow.connector.ByteBufferPool)} */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandlingSockJsService.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandlingSockJsService.java index d876ef45b3b..6d2e57d7587 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandlingSockJsService.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/TransportHandlingSockJsService.java @@ -367,10 +367,10 @@ public class TransportHandlingSockJsService extends AbstractSockJsService implem } this.sessionCleanupTask = getTaskScheduler().scheduleAtFixedRate(() -> { List removedIds = new ArrayList<>(); - for (SockJsSession session : sessions.values()) { + for (SockJsSession session : this.sessions.values()) { try { if (session.getTimeSinceLastActive() > getDisconnectDelay()) { - sessions.remove(session.getId()); + this.sessions.remove(session.getId()); removedIds.add(session.getId()); session.close(); }