Skip to content

Commit 4ba1743

Browse files
committed
Polishing
1 parent 09c8586 commit 4ba1743

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

spring-messaging/src/main/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -223,8 +223,8 @@ protected String getUserRegistryBroadcast() {
223223
}
224224

225225

226+
@Override
226227
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {
227-
228228
StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(
229229
getClientInboundChannel(), getClientOutboundChannel(),
230230
brokerChannel, getDestinationPrefixes());

spring-webmvc/src/main/java/org/springframework/web/servlet/config/AnnotationDrivenBeanDefinitionParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
157157
ClassUtils.isPresent("javax.validation.Validator",
158158
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
159159

160-
private static boolean romePresent =
160+
private static final boolean romePresent =
161161
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
162162
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
163163

@@ -197,7 +197,7 @@ public BeanDefinition parse(Element element, ParserContext context) {
197197
handlerMappingDef.getPropertyValues().add("contentNegotiationManager", contentNegotiationManager);
198198

199199
if (element.hasAttribute("enable-matrix-variables")) {
200-
Boolean enableMatrixVariables = Boolean.valueOf(element.getAttribute("enable-matrix-variables"));
200+
boolean enableMatrixVariables = Boolean.parseBoolean(element.getAttribute("enable-matrix-variables"));
201201
handlerMappingDef.getPropertyValues().add("removeSemicolonContent", !enableMatrixVariables);
202202
}
203203
else if (element.hasAttribute("enableMatrixVariables")) {
@@ -545,7 +545,7 @@ private ManagedList<?> getMessageConverters(Element element, Object source, Pars
545545
}
546546
}
547547

548-
if (convertersElement == null || Boolean.valueOf(convertersElement.getAttribute("register-defaults"))) {
548+
if (convertersElement == null || Boolean.parseBoolean(convertersElement.getAttribute("register-defaults"))) {
549549
messageConverters.setSource(source);
550550
messageConverters.add(createConverterDefinition(ByteArrayHttpMessageConverter.class, source));
551551

spring-webmvc/src/main/java/org/springframework/web/servlet/config/ResourcesBeanDefinitionParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -80,7 +80,7 @@ class ResourcesBeanDefinitionParser implements BeanDefinitionParser {
8080

8181
private static final String RESOURCE_URL_PROVIDER = "mvcResourceUrlProvider";
8282

83-
private static final boolean isWebJarsAssetLocatorPresent = ClassUtils.isPresent(
83+
private static final boolean webJarsPresent = ClassUtils.isPresent(
8484
"org.webjars.WebJarAssetLocator", ResourcesBeanDefinitionParser.class.getClassLoader());
8585

8686

@@ -329,7 +329,7 @@ private void parseResourceResolversTransformers(boolean isAutoRegistration,
329329
}
330330

331331
if (isAutoRegistration) {
332-
if (isWebJarsAssetLocatorPresent) {
332+
if (webJarsPresent) {
333333
RootBeanDefinition webJarsResolverDef = new RootBeanDefinition(WebJarsResourceResolver.class);
334334
webJarsResolverDef.setSource(source);
335335
webJarsResolverDef.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);

spring-websocket/src/main/java/org/springframework/web/socket/WebSocketSession.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2020 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.
@@ -114,6 +114,12 @@ public interface WebSocketSession extends Closeable {
114114

115115
/**
116116
* Send a WebSocket message: either {@link TextMessage} or {@link BinaryMessage}.
117+
* <p><strong>Note:</strong> The underlying standard WebSocket session (JSR-356) does
118+
* not allow concurrent sending. Therefore sending must be synchronized. To ensure
119+
* that, one option is to wrap the {@code WebSocketSession} with the
120+
* {@link org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
121+
* ConcurrentWebSocketSessionDecorator}.
122+
* @see org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator
117123
*/
118124
void sendMessage(WebSocketMessage<?> message) throws IOException;
119125

0 commit comments

Comments
 (0)