Skip to content

Commit 083b23e

Browse files
committed
Polishing
1 parent 0dd87e8 commit 083b23e

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
*
3535
* <p>As of Spring 3.1, {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
3636
* PropertySourcesPlaceholderConfigurer} should be used preferentially over this implementation; it is
37-
* more flexible through taking advantage of the {@link org.springframework.core.env.Environment Environment} and
38-
* {@link org.springframework.core.env.PropertySource PropertySource} mechanisms also made available in Spring 3.1.
37+
* more flexible through taking advantage of the {@link org.springframework.core.env.Environment} and
38+
* {@link org.springframework.core.env.PropertySource} mechanisms also made available in Spring 3.1.
3939
*
4040
* <p>{@link PropertyPlaceholderConfigurer} is still appropriate for use when:
4141
* <ul>
@@ -118,8 +118,8 @@ public void setSystemPropertiesMode(int systemPropertiesMode) {
118118
* to pass external values in as JVM system properties: This can easily be
119119
* achieved in a startup script, even for existing environment variables.
120120
* @see #setSystemPropertiesMode
121-
* @see java.lang.System#getProperty(String)
122-
* @see java.lang.System#getenv(String)
121+
* @see System#getProperty(String)
122+
* @see System#getenv(String)
123123
*/
124124
public void setSearchSystemEnvironment(boolean searchSystemEnvironment) {
125125
this.searchSystemEnvironment = searchSystemEnvironment;

spring-websocket/src/test/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParserTests.java

Lines changed: 10 additions & 11 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-2019 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.
@@ -320,7 +320,7 @@ public void stompBrokerRelay() {
320320
"processed CONNECT\\(0\\)-CONNECTED\\(0\\)-DISCONNECT\\(0\\)\\], " +
321321
"inboundChannel\\[pool size = \\d, active threads = \\d, queued tasks = \\d, " +
322322
"completed tasks = \\d\\], " +
323-
"outboundChannelpool size = \\d, active threads = \\d, queued tasks = \\d, " +
323+
"outboundChannel\\[pool size = \\d, active threads = \\d, queued tasks = \\d, " +
324324
"completed tasks = \\d\\], " +
325325
"sockJsScheduler\\[pool size = \\d, active threads = \\d, queued tasks = \\d, " +
326326
"completed tasks = \\d\\]";
@@ -442,27 +442,23 @@ public void messageConvertersDefaultsOff() {
442442
}
443443

444444

445-
private void testChannel(String channelName, List<Class<? extends MessageHandler>> subscriberTypes,
446-
int interceptorCount) {
445+
private void testChannel(
446+
String channelName, List<Class<? extends MessageHandler>> subscriberTypes, int interceptorCount) {
447447

448448
AbstractSubscribableChannel channel = this.appContext.getBean(channelName, AbstractSubscribableChannel.class);
449-
450449
for (Class<? extends MessageHandler> subscriberType : subscriberTypes) {
451450
MessageHandler subscriber = this.appContext.getBean(subscriberType);
452-
assertNotNull("No subsription for " + subscriberType, subscriber);
451+
assertNotNull("No subscription for " + subscriberType, subscriber);
453452
assertTrue(channel.hasSubscription(subscriber));
454453
}
455-
456454
List<ChannelInterceptor> interceptors = channel.getInterceptors();
457455
assertEquals(interceptorCount, interceptors.size());
458456
assertEquals(ImmutableMessageChannelInterceptor.class, interceptors.get(interceptors.size()-1).getClass());
459457
}
460458

461459
private void testExecutor(String channelName, int corePoolSize, int maxPoolSize, int keepAliveSeconds) {
462-
463460
ThreadPoolTaskExecutor taskExecutor =
464461
this.appContext.getBean(channelName + "Executor", ThreadPoolTaskExecutor.class);
465-
466462
assertEquals(corePoolSize, taskExecutor.getCorePoolSize());
467463
assertEquals(maxPoolSize, taskExecutor.getMaxPoolSize());
468464
assertEquals(keepAliveSeconds, taskExecutor.getKeepAliveSeconds());
@@ -480,6 +476,7 @@ private WebSocketHandler unwrapWebSocketHandler(WebSocketHandler handler) {
480476
return (handler instanceof WebSocketHandlerDecorator) ?
481477
((WebSocketHandlerDecorator) handler).getLastHandler() : handler;
482478
}
479+
483480
}
484481

485482

@@ -506,7 +503,6 @@ public boolean supportsReturnType(MethodParameter returnType) {
506503

507504
@Override
508505
public void handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message) throws Exception {
509-
510506
}
511507
}
512508

@@ -537,12 +533,15 @@ public void afterConnectionEstablished(WebSocketSession session) throws Exceptio
537533
class TestStompErrorHandler extends StompSubProtocolErrorHandler {
538534
}
539535

536+
540537
class TestValidator implements Validator {
538+
541539
@Override
542540
public boolean supports(Class<?> clazz) {
543541
return false;
544542
}
545543

546544
@Override
547-
public void validate(@Nullable Object target, Errors errors) { }
545+
public void validate(@Nullable Object target, Errors errors) {
546+
}
548547
}

spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupportTests.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2019 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.
@@ -48,7 +48,6 @@
4848
import org.springframework.stereotype.Controller;
4949
import org.springframework.web.servlet.HandlerMapping;
5050
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
51-
import org.springframework.web.socket.TextMessage;
5251
import org.springframework.web.socket.WebSocketHandler;
5352
import org.springframework.web.socket.WebSocketSession;
5453
import org.springframework.web.socket.config.WebSocketMessageBrokerStats;
@@ -61,16 +60,11 @@
6160
import org.springframework.web.socket.messaging.SubProtocolWebSocketHandler;
6261
import org.springframework.web.socket.server.support.WebSocketHttpRequestHandler;
6362

64-
import static org.junit.Assert.assertArrayEquals;
65-
import static org.junit.Assert.assertEquals;
66-
import static org.junit.Assert.assertFalse;
67-
import static org.junit.Assert.assertNotNull;
68-
import static org.junit.Assert.assertTrue;
69-
import static org.mockito.Mockito.mock;
63+
import static org.junit.Assert.*;
64+
import static org.mockito.Mockito.*;
7065

7166
/**
72-
* Test fixture for
73-
* {@link org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurationSupport}.
67+
* Test fixture for {@link WebSocketMessageBrokerConfigurationSupport}.
7468
*
7569
* @author Rossen Stoyanchev
7670
*/
@@ -100,8 +94,8 @@ public void clientInboundChannelSendMessage() throws Exception {
10094
session.setOpen(true);
10195
webSocketHandler.afterConnectionEstablished(session);
10296

103-
TextMessage textMessage = StompTextMessageBuilder.create(StompCommand.SEND).headers("destination:/foo").build();
104-
webSocketHandler.handleMessage(session, textMessage);
97+
webSocketHandler.handleMessage(session,
98+
StompTextMessageBuilder.create(StompCommand.SEND).headers("destination:/foo").build());
10599

106100
Message<?> message = channel.messages.get(0);
107101
StompHeaderAccessor accessor = StompHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
@@ -177,7 +171,7 @@ public void webSocketMessageBrokerStats() {
177171
"stompSubProtocol\\[processed CONNECT\\(0\\)-CONNECTED\\(0\\)-DISCONNECT\\(0\\)\\], " +
178172
"stompBrokerRelay\\[null\\], " +
179173
"inboundChannel\\[pool size = \\d, active threads = \\d, queued tasks = \\d, completed tasks = \\d\\], " +
180-
"outboundChannelpool size = \\d, active threads = \\d, queued tasks = \\d, completed tasks = \\d\\], " +
174+
"outboundChannel\\[pool size = \\d, active threads = \\d, queued tasks = \\d, completed tasks = \\d\\], " +
181175
"sockJsScheduler\\[pool size = \\d, active threads = \\d, queued tasks = \\d, completed tasks = \\d\\]";
182176

183177
assertTrue("\nExpected: " + expected.replace("\\", "") + "\n Actual: " + actual, actual.matches(expected));

0 commit comments

Comments
 (0)