From 03f0c577048c086c303f20d433a20e575a6aa66e Mon Sep 17 00:00:00 2001 From: Marc Wrobel Date: Mon, 11 Jul 2022 19:22:48 +0200 Subject: [PATCH] Fix and improve Javadoc in spring-websocket Closes gh-28788 --- .../org/springframework/web/socket/CloseStatus.java | 4 ++-- .../springframework/web/socket/WebSocketExtension.java | 4 ++-- .../springframework/web/socket/WebSocketSession.java | 4 ++-- .../socket/adapter/jetty/JettyWebSocketSession.java | 4 ++-- .../standard/ConvertingEncoderDecoderSupport.java | 10 +++++----- .../standard/StandardToWebSocketExtensionAdapter.java | 6 +++--- .../adapter/standard/StandardWebSocketSession.java | 4 ++-- .../web/socket/client/ConnectionManagerSupport.java | 4 ++-- .../web/socket/client/jetty/JettyWebSocketClient.java | 4 ++-- .../AbstractWebSocketHandlerRegistration.java | 4 ++-- .../config/annotation/SockJsServiceRegistration.java | 4 ++-- .../annotation/WebSocketMessageBrokerConfigurer.java | 6 +++--- .../annotation/WebSocketTransportRegistration.java | 6 +++--- .../handler/ConcurrentWebSocketSessionDecorator.java | 4 ++-- .../handler/WebSocketHandlerDecoratorFactory.java | 4 ++-- .../WebSocketAnnotationMethodMessageHandler.java | 4 ++-- .../socket/server/standard/ServerEndpointExporter.java | 4 ++-- .../server/support/AbstractHandshakeHandler.java | 10 +++++----- .../web/socket/sockjs/client/SockJsClient.java | 6 +++--- .../sockjs/frame/AbstractSockJsMessageCodec.java | 4 ++-- .../socket/sockjs/transport/SockJsServiceConfig.java | 4 ++-- .../transport/session/AbstractSockJsSession.java | 4 ++-- .../session/WebSocketServerSockJsSession.java | 4 ++-- .../handler/HttpReceivingTransportHandlerTests.java | 4 ++-- .../handler/HttpSendingTransportHandlerTests.java | 4 ++-- 25 files changed, 60 insertions(+), 60 deletions(-) diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java b/spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java index 493f009283a..66b084bd77b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/CloseStatus.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -139,7 +139,7 @@ public final class CloseStatus implements Serializable { public static final CloseStatus TLS_HANDSHAKE_FAILURE = new CloseStatus(1015); /** - * A status code for use within the framework the indicate a session has + * A status code for use within the framework that indicates a session has * become unreliable (e.g. timed out while sending a message) and extra * care should be exercised, e.g. avoid sending any further data to the * client that may be done during normal shutdown. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketExtension.java b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketExtension.java index 8c18d4ff8aa..da31a3b8c4e 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketExtension.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -83,7 +83,7 @@ public class WebSocketExtension { /** - * Return the name of the extension (never {@code null) or empty}. + * Return the name of the extension (never {@code null} or empty). */ public String getName() { return this.name; diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java index 56388d9b47d..00878291d21 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -121,7 +121,7 @@ public interface WebSocketSession extends Closeable { /** * Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}. *

Note: The underlying standard WebSocket session (JSR-356) does - * not allow concurrent sending. Therefore sending must be synchronized. To ensure + * not allow concurrent sending. Therefore, sending must be synchronized. To ensure * that, one option is to wrap the {@code WebSocketSession} with the * {@link org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator * ConcurrentWebSocketSessionDecorator}. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/jetty/JettyWebSocketSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/jetty/JettyWebSocketSession.java index 48b87417bbf..d748491f865 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/jetty/JettyWebSocketSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/jetty/JettyWebSocketSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -95,7 +95,7 @@ public class JettyWebSocketSession extends AbstractWebSocketSession { * Create a new {@link JettyWebSocketSession} instance associated with the given user. * @param attributes the attributes from the HTTP handshake to associate with the WebSocket * session; the provided attributes are copied, the original map is not used. - * @param user the user associated with the session; if {@code null} we'll fallback on the + * @param user the user associated with the session; if {@code null} we'll fall back on the * user available via {@link org.eclipse.jetty.websocket.api.Session#getUpgradeRequest()} */ public JettyWebSocketSession(Map attributes, @Nullable Principal user) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupport.java index 05e1a4b75c0..eecdcf17bab 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/ConvertingEncoderDecoderSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -101,7 +101,7 @@ public abstract class ConvertingEncoderDecoderSupport { } /** - * Strategy method used to obtain the {@link ConversionService}. By default this + * Strategy method used to obtain the {@link ConversionService}. By default, this * method expects a bean named {@code 'webSocketConversionService'} in the * {@link #getApplicationContext() active ApplicationContext}. * @return the {@link ConversionService} (never null) @@ -119,7 +119,7 @@ public abstract class ConvertingEncoderDecoderSupport { } /** - * Returns the active {@link ApplicationContext}. Be default this method obtains + * Returns the active {@link ApplicationContext}. By default, this method obtains * the context via {@link ContextLoader#getCurrentWebApplicationContext()}, which * finds the ApplicationContext loaded via {@link ContextLoader} typically in a * Servlet container environment. When not running in a Servlet container and @@ -132,7 +132,7 @@ public abstract class ConvertingEncoderDecoderSupport { } /** - * Returns the type being converted. By default the type is resolved using + * Returns the type being converted. By default, the type is resolved using * the generic arguments of the class. */ protected TypeDescriptor getType() { @@ -140,7 +140,7 @@ public abstract class ConvertingEncoderDecoderSupport { } /** - * Returns the websocket message type. By default the type is resolved using + * Returns the websocket message type. By default, the type is resolved using * the generic arguments of the class. */ protected TypeDescriptor getMessageType() { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java index d2908e6aff8..64692d49400 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardToWebSocketExtensionAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2022 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. @@ -26,8 +26,8 @@ import org.springframework.util.LinkedCaseInsensitiveMap; import org.springframework.web.socket.WebSocketExtension; /** - * A sub-class of {@link org.springframework.web.socket.WebSocketExtension} that - * can be constructed from an {@link javax.websocket.Extension}. + * A subclass of {@link org.springframework.web.socket.WebSocketExtension} that + * can be constructed from a {@link javax.websocket.Extension}. * * @author Rossen Stoyanchev * @since 4.0 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardWebSocketSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardWebSocketSession.java index d1a0672b956..a349d3f84df 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardWebSocketSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/adapter/standard/StandardWebSocketSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -95,7 +95,7 @@ public class StandardWebSocketSession extends AbstractWebSocketSession * @param localAddress the address on which the request was received * @param remoteAddress the address of the remote client * @param user the user associated with the session; if {@code null} we'll - * fallback on the user available in the underlying WebSocket session + * fall back on the user available in the underlying WebSocket session */ public StandardWebSocketSession(@Nullable HttpHeaders headers, @Nullable Map attributes, @Nullable InetSocketAddress localAddress, @Nullable InetSocketAddress remoteAddress, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java index 93c736557d9..03e816d5883 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/ConnectionManagerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -81,7 +81,7 @@ public abstract class ConnectionManagerSupport implements SmartLifecycle { /** * Specify the phase in which a connection should be established to the remote * endpoint and subsequently closed. The startup order proceeds from lowest to - * highest, and the shutdown order is the reverse of that. By default this value is + * highest, and the shutdown order is the reverse of that. By default, this value is * Integer.MAX_VALUE meaning that this endpoint connection factory connects as late as * possible and is closed as soon as possible. */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java index 982bbfa61e4..2c5d8a5a34e 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/client/jetty/JettyWebSocketClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -199,7 +199,7 @@ public class JettyWebSocketClient extends AbstractWebSocketClient implements Lif /** * Return the user to make available through {@link WebSocketSession#getPrincipal()}. - * By default this method returns {@code null} + * By default, this method returns {@code null} */ @Nullable protected Principal getUser() { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/AbstractWebSocketHandlerRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/AbstractWebSocketHandlerRegistration.java index b43b3291ad9..cf6927de02f 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/AbstractWebSocketHandlerRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/AbstractWebSocketHandlerRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -36,7 +36,7 @@ import org.springframework.web.socket.sockjs.transport.handler.WebSocketTranspor /** * Base class for {@link WebSocketHandlerRegistration WebSocketHandlerRegistrations} that gathers all the configuration - * options but allows sub-classes to put together the actual HTTP request mappings. + * options but allows subclasses to put together the actual HTTP request mappings. * * @author Rossen Stoyanchev * @author Sebastien Deleuze diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java index edc4e568a87..8b430c7a65b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/SockJsServiceRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -120,7 +120,7 @@ public class SockJsServiceRegistration { * Streaming transports save responses on the client side and don't free * memory used by delivered messages. Such transports need to recycle the * connection once in a while. This property sets a minimum number of bytes - * that can be send over a single HTTP streaming request before it will be + * that can be sent over a single HTTP streaming request before it will be * closed. After that client will open a new request. Setting this value to * one effectively disables streaming and will make streaming transports to * behave like polling transports. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurer.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurer.java index ae23ef35ffc..24036055c09 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurer.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurer.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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 interface WebSocketMessageBrokerConfigurer { /** * Configure the {@link org.springframework.messaging.MessageChannel} used for - * incoming messages from WebSocket clients. By default the channel is backed + * incoming messages from WebSocket clients. By default, the channel is backed * by a thread pool of size 1. It is recommended to customize thread pool * settings for production use. */ @@ -61,7 +61,7 @@ public interface WebSocketMessageBrokerConfigurer { /** * Configure the {@link org.springframework.messaging.MessageChannel} used for - * outbound messages to WebSocket clients. By default the channel is backed + * outbound messages to WebSocket clients. By default, the channel is backed * by a thread pool of size 1. It is recommended to customize thread pool * settings for production use. */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketTransportRegistration.java b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketTransportRegistration.java index f860aa5f1d8..5d52f934629 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketTransportRegistration.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/config/annotation/WebSocketTransportRegistration.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -87,7 +87,7 @@ public class WebSocketTransportRegistration { *

NOTE that closing the session may not succeed in * actually closing the physical socket and may also hang. This is true * especially when using blocking IO such as the BIO connector in Tomcat - * that is used by default on Tomcat 7. Therefore it is recommended to ensure + * that is used by default on Tomcat 7. Therefore, it is recommended to ensure * the server is using non-blocking IO such as Tomcat's NIO connector that * is used by default on Tomcat 8. If you must use blocking IO consider * customizing OS-level TCP settings, for example @@ -123,7 +123,7 @@ public class WebSocketTransportRegistration { *

NOTE that closing the session may not succeed in * actually closing the physical socket and may also hang. This is true * especially when using blocking IO such as the BIO connector in Tomcat - * configured by default on Tomcat 7. Therefore it is recommended to ensure + * configured by default on Tomcat 7. Therefore, it is recommended to ensure * the server is using non-blocking IO such as Tomcat's NIO connector used * by default on Tomcat 8. If you must use blocking IO consider customizing * OS-level TCP settings, for example {@code /proc/sys/net/ipv4/tcp_retries2} diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java b/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java index 46f3149fe85..2e072035e42 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/handler/ConcurrentWebSocketSessionDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -289,7 +289,7 @@ public class ConcurrentWebSocketSessionDecorator extends WebSocketSessionDecorat public enum OverflowStrategy { /** - * Throw {@link SessionLimitExceededException} that would will result + * Throw {@link SessionLimitExceededException} that will result * in the session being terminated. */ TERMINATE, diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/handler/WebSocketHandlerDecoratorFactory.java b/spring-websocket/src/main/java/org/springframework/web/socket/handler/WebSocketHandlerDecoratorFactory.java index f3110fc7195..8a3cc640f30 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/handler/WebSocketHandlerDecoratorFactory.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/handler/WebSocketHandlerDecoratorFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2022 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. @@ -34,7 +34,7 @@ public interface WebSocketHandlerDecoratorFactory { /** * Decorate the given WebSocketHandler. * @param handler the handler to be decorated. - * @return the same handler or the handler wrapped with a sub-class of + * @return the same handler or the handler wrapped with a subclass of * {@code WebSocketHandlerDecorator}. */ WebSocketHandler decorate(WebSocketHandler handler); diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java index 847741b2c1f..f4a5eb4826c 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/WebSocketAnnotationMethodMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 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. @@ -30,7 +30,7 @@ import org.springframework.messaging.simp.annotation.support.SimpAnnotationMetho import org.springframework.web.method.ControllerAdviceBean; /** - * A sub-class of {@link SimpAnnotationMethodMessageHandler} to provide support + * A subclass of {@link SimpAnnotationMethodMessageHandler} to provide support * for {@link org.springframework.web.bind.annotation.ControllerAdvice * ControllerAdvice} with global {@code @MessageExceptionHandler} methods. * diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java index acbce32b8d3..643d5012414 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/standard/ServerEndpointExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -66,7 +66,7 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport /** * Explicitly list annotated endpoint types that should be registered on startup. This * can be done if you wish to turn off a Servlet container's scan for endpoints, which - * goes through all 3rd party jars in the, and rely on Spring configuration instead. + * goes through all 3rd party jars in the classpath, and rely on Spring configuration instead. * @param annotatedEndpointClasses {@link ServerEndpoint}-annotated types */ public void setAnnotatedEndpointClasses(Class... annotatedEndpointClasses) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java index 4c9fa3ea2dd..918c84298d5 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/server/support/AbstractHandshakeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 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. @@ -49,7 +49,7 @@ import org.springframework.web.socket.server.HandshakeHandler; import org.springframework.web.socket.server.RequestUpgradeStrategy; /** - * A base class for {@link HandshakeHandler} implementations, independent from the Servlet API. + * A base class for {@link HandshakeHandler} implementations, independent of the Servlet API. * *

Performs initial validation of the WebSocket handshake request - possibly rejecting it * through the appropriate HTTP status code - while also allowing its subclasses to override @@ -58,7 +58,7 @@ import org.springframework.web.socket.server.RequestUpgradeStrategy; * *

If the negotiation succeeds, the actual upgrade is delegated to a server-specific * {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update - * the response as necessary and initialize the WebSocket. Currently supported servers are + * the response as necessary and initialize the WebSocket. Currently, supported servers are * Jetty 9.0-9.3, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.3, GlassFish 4.1+, WebLogic 12.1.3+. * * @author Rossen Stoyanchev @@ -184,9 +184,9 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life * is accepted. If there are no matches the response will not contain a * {@literal Sec-WebSocket-Protocol} header. *

Note that if the WebSocketHandler passed in at runtime is an instance of - * {@link SubProtocolCapable} then there is not need to explicitly configure + * {@link SubProtocolCapable} then there is no need to explicitly configure * this property. That is certainly the case with the built-in STOMP over - * WebSocket support. Therefore this property should be configured explicitly + * WebSocket support. Therefore, this property should be configured explicitly * only if the WebSocketHandler does not implement {@code SubProtocolCapable}. */ public void setSupportedProtocols(String... protocols) { diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java index 1ac4bc8fba4..4b9d0da9f8c 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/client/SockJsClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -50,7 +50,7 @@ import org.springframework.web.util.UriComponentsBuilder; * A SockJS implementation of * {@link org.springframework.web.socket.client.WebSocketClient WebSocketClient} * with fallback alternatives that simulate a WebSocket interaction through plain - * HTTP streaming and long polling techniques.. + * HTTP streaming and long polling techniques. * *

Implements {@link Lifecycle} in order to propagate lifecycle events to * the transports it is configured with. @@ -342,7 +342,7 @@ public class SockJsClient implements WebSocketClient, Lifecycle { } /** - * By default the result of a SockJS "Info" request, including whether the + * By default, the result of a SockJS "Info" request, including whether the * server has WebSocket disabled and how long the request took (used for * calculating transport timeout time) is cached. This method can be used to * clear that cache hence causing it to re-populate. diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/AbstractSockJsMessageCodec.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/AbstractSockJsMessageCodec.java index e6baf97d77f..dbf3461f8bc 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/AbstractSockJsMessageCodec.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/frame/AbstractSockJsMessageCodec.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -19,7 +19,7 @@ package org.springframework.web.socket.sockjs.frame; import org.springframework.util.Assert; /** - * An base class for SockJS message codec that provides an implementation of + * A base class for SockJS message codec that provides an implementation of * {@link #encode(String[])}. * * @author Rossen Stoyanchev diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsServiceConfig.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsServiceConfig.java index dcf475f0f77..d6bb37216e1 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsServiceConfig.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsServiceConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2022 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. @@ -60,7 +60,7 @@ public interface SockJsServiceConfig { * property since even streaming transports recycle HTTP requests periodically. *

The amount of time between HTTP requests should be relatively brief and will not * exceed the allows disconnect delay (see - * {@link org.springframework.web.socket.sockjs.support.AbstractSockJsService#setDisconnectDelay(long)}, + * {@link org.springframework.web.socket.sockjs.support.AbstractSockJsService#setDisconnectDelay(long)}), * 5 seconds by default. *

The default size is 100. */ diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java index 3f33a3de896..df2b745d53f 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 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. @@ -61,7 +61,7 @@ public abstract class AbstractSockJsSession implements SockJsSession { * Log category to use on network IO exceptions after a client has gone away. *

Servlet containers don't expose a client disconnected callback; see * eclipse-ee4j/servlet-api#44. - * Therefore network IO failures may occur simply because a client has gone away, + * Therefore, network IO failures may occur simply because a client has gone away, * and that can fill the logs with unnecessary stack traces. *

We make a best effort to identify such network failures, on a per-server * basis, and log them under a separate log category. A simple one-line message diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/WebSocketServerSockJsSession.java b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/WebSocketServerSockJsSession.java index a8ed9363270..611d51f739b 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/WebSocketServerSockJsSession.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/WebSocketServerSockJsSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 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. @@ -159,7 +159,7 @@ public class WebSocketServerSockJsSession extends AbstractSockJsSession implemen delegateConnectionEstablished(); this.webSocketSession.sendMessage(new TextMessage(SockJsFrame.openFrame().getContent())); - // Flush any messages cached in the mean time + // Flush any messages cached in the meantime while (!this.initSessionCache.isEmpty()) { writeFrame(SockJsFrame.messageFrame(getMessageCodec(), this.initSessionCache.poll())); } diff --git a/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpReceivingTransportHandlerTests.java b/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpReceivingTransportHandlerTests.java index 996391d16ee..9d9639cd5bf 100644 --- a/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpReceivingTransportHandlerTests.java +++ b/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpReceivingTransportHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 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. @@ -35,7 +35,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; /** - * Test fixture for {@link AbstractHttpReceivingTransportHandler} and sub-classes + * Test fixture for {@link AbstractHttpReceivingTransportHandler} and subclasses * {@link XhrReceivingTransportHandler}. * * @author Rossen Stoyanchev diff --git a/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpSendingTransportHandlerTests.java b/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpSendingTransportHandlerTests.java index 48cb9bd4392..c4d5d766a02 100644 --- a/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpSendingTransportHandlerTests.java +++ b/spring-websocket/src/test/java/org/springframework/web/socket/sockjs/transport/handler/HttpSendingTransportHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2022 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. @@ -36,7 +36,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; /** - * Test fixture for {@link AbstractHttpSendingTransportHandler} and sub-classes. + * Test fixture for {@link AbstractHttpSendingTransportHandler} and subclasses. * * @author Rossen Stoyanchev */