Skip to content

Commit 92bf32b

Browse files
committed
Polishing
1 parent e0a11f2 commit 92bf32b

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public static void removeWebAppRootSystemProperty(ServletContext servletContext)
191191
* i.e. the value of the "defaultHtmlEscape" context-param in {@code web.xml}
192192
* (if any). Falls back to {@code false} in case of no explicit default given.
193193
* @param servletContext the servlet context of the web application
194-
* @return whether default HTML escaping is enabled (default is false)
194+
* @return whether default HTML escaping is enabled (default is {@code false})
195195
* @deprecated as of Spring 4.1, in favor of {@link #getDefaultHtmlEscape}
196196
*/
197197
@Deprecated
@@ -211,7 +211,8 @@ public static boolean isDefaultHtmlEscape(ServletContext servletContext) {
211211
* an actual boolean value specified, allowing to have a context-specific
212212
* default in case of no setting at the global level.
213213
* @param servletContext the servlet context of the web application
214-
* @return whether default HTML escaping is enabled (null = no explicit default)
214+
* @return whether default HTML escaping is enabled for the given application
215+
* ({@code null} = no explicit default)
215216
*/
216217
public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
217218
if (servletContext == null) {
@@ -231,7 +232,8 @@ public static Boolean getDefaultHtmlEscape(ServletContext servletContext) {
231232
* an actual boolean value specified, allowing to have a context-specific
232233
* default in case of no setting at the global level.
233234
* @param servletContext the servlet context of the web application
234-
* @return whether response encoding is used for HTML escaping (null = no explicit default)
235+
* @return whether response encoding is to be used for HTML escaping
236+
* ({@code null} = no explicit default)
235237
* @since 4.1.2
236238
*/
237239
public static Boolean getResponseEncodedHtmlEscape(ServletContext servletContext) {

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)