Skip to content

Commit bf38b3a

Browse files
committed
Polishing
(cherry picked from commit 92bf32b)
1 parent aa3a78a commit bf38b3a

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

spring-web/src/main/java/org/springframework/web/util/WebUtils.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public static void removeWebAppRootSystemProperty(ServletContext servletContext)
190190
* i.e. the value of the "defaultHtmlEscape" context-param in {@code web.xml}
191191
* (if any). Falls back to {@code false} in case of no explicit default given.
192192
* @param servletContext the servlet context of the web application
193-
* @return whether default HTML escaping is enabled (default is false)
193+
* @return whether default HTML escaping is enabled (default is {@code false})
194194
* @deprecated as of Spring 4.1, in favor of {@link #getDefaultHtmlEscape}
195195
*/
196196
@Deprecated
@@ -210,7 +210,8 @@ public static boolean isDefaultHtmlEscape(ServletContext servletContext) {
210210
* an actual boolean value specified, allowing to have a context-specific
211211
* default in case of no setting at the global level.
212212
* @param servletContext the servlet context of the web application
213-
* @return whether default HTML escaping is enabled (null = no explicit default)
213+
* @return whether default HTML escaping is enabled for the given application
214+
* ({@code null} = no explicit default)
214215
*/
215216
public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
216217
if (servletContext == null) {
@@ -230,7 +231,8 @@ public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
230231
* an actual boolean value specified, allowing to have a context-specific
231232
* default in case of no setting at the global level.
232233
* @param servletContext the servlet context of the web application
233-
* @return whether response encoding is used for HTML escaping (null = no explicit default)
234+
* @return whether response encoding is to be used for HTML escaping
235+
* ({@code null} = no explicit default)
234236
* @since 4.1.2
235237
*/
236238
public static Boolean getResponseEncodedHtmlEscape(ServletContext servletContext) {
@@ -749,7 +751,7 @@ public static String extractFullFilenameFromUrlPath(String urlPath) {
749751
* keys {@code "q1"} and {@code "q2"} with values {@code ["a","b"]} and
750752
* {@code ["a","b","c"]} respectively.
751753
* @param matrixVariables the unparsed matrix variables string
752-
* @return a map with matrix variable names and values, never {@code null}
754+
* @return a map with matrix variable names and values (never {@code null})
753755
* @since 3.2
754756
*/
755757
public static MultiValueMap<String, String> parseMatrixVariables(String matrixVariables) {
@@ -779,7 +781,7 @@ public static MultiValueMap<String, String> parseMatrixVariables(String matrixVa
779781
* Check the given request origin against a list of allowed origins.
780782
* A list containing "*" means that all origins are allowed.
781783
* An empty list means only same origin is allowed.
782-
* @return true if the request origin is valid, false otherwise
784+
* @return {@code true} if the request origin is valid, {@code false} otherwise
783785
* @since 4.1.5
784786
* @see <a href="https://tools.ietf.org/html/rfc6454">RFC 6454: The Web Origin Concept</a>
785787
*/

spring-websocket/src/main/java/org/springframework/web/socket/server/standard/UndertowRequestUpgradeStrategy.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -55,11 +55,12 @@
5555
import org.springframework.util.ClassUtils;
5656
import org.springframework.web.socket.server.HandshakeFailureException;
5757

58-
5958
/**
6059
* A {@link org.springframework.web.socket.server.RequestUpgradeStrategy} for use
6160
* with WildFly and its underlying Undertow web server.
6261
*
62+
* <p>Compatible with Undertow 1.0, 1.1, 1.2 - as included in WildFly 8.x and 9.0.
63+
*
6364
* @author Rossen Stoyanchev
6465
* @since 4.0.1
6566
*/
@@ -201,11 +202,11 @@ private ConfiguredServerEndpoint createConfiguredServerEndpoint(String selectedP
201202
Collections.<Class<?>, List<InstanceFactory<? extends Encoder>>>emptyMap(),
202203
Collections.<Class<?>, List<InstanceFactory<? extends Decoder>>>emptyMap());
203204
try {
204-
return undertow11Present ?
205+
return (undertow11Present ?
205206
endpointConstructor.newInstance(endpointRegistration,
206-
new EndpointInstanceFactory(endpoint), null, encodingFactory, null) :
207+
new EndpointInstanceFactory(endpoint), null, encodingFactory, null) :
207208
endpointConstructor.newInstance(endpointRegistration,
208-
new EndpointInstanceFactory(endpoint), null, encodingFactory);
209+
new EndpointInstanceFactory(endpoint), null, encodingFactory));
209210
}
210211
catch (Exception ex) {
211212
throw new HandshakeFailureException("Failed to instantiate ConfiguredServerEndpoint", ex);

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/SockJsSession.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,9 +34,10 @@ public interface SockJsSession extends WebSocketSession {
3434
long getTimeSinceLastActive();
3535

3636
/**
37-
* Disable SockJS heartbeat, presumably because a higher level protocol has
38-
* heartbeats enabled for the session. It is not recommended to disable this
39-
* otherwise as it helps proxies to know the connection is not hanging.
37+
* Disable the SockJS heartbeat, presumably because a higher-level protocol
38+
* has heartbeats enabled for the session already. It is not recommended to
39+
* disable this otherwise, as it helps proxies to know the connection is
40+
* not hanging.
4041
*/
4142
void disableHeartbeat();
4243

spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/session/AbstractSockJsSession.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2014 the original author or authors.
2+
* Copyright 2002-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -52,7 +52,7 @@
5252
*/
5353
public abstract class AbstractSockJsSession implements SockJsSession {
5454

55-
private static enum State {NEW, OPEN, CLOSED}
55+
private enum State {NEW, OPEN, CLOSED}
5656

5757

5858
/**
@@ -339,7 +339,7 @@ protected void writeFrame(SockJsFrame frame) throws SockJsTransportFailureExcept
339339
catch (Throwable closeFailure) {
340340
// Nothing of consequence, already forced disconnect
341341
}
342-
throw new SockJsTransportFailureException("Failed to write " + frame, this.getId(), ex);
342+
throw new SockJsTransportFailureException("Failed to write " + frame, getId(), ex);
343343
}
344344
}
345345

@@ -360,7 +360,7 @@ else if (disconnectedClientLogger.isDebugEnabled()) {
360360
}
361361
}
362362
else {
363-
logger.debug("Terminating connection after failure to send message to client.", failure);
363+
logger.debug("Terminating connection after failure to send message to client", failure);
364364
}
365365
}
366366

0 commit comments

Comments
 (0)