Consistent formatting

This commit is contained in:
Juergen Hoeller
2016-03-24 19:22:49 +01:00
parent 2cdb0cf690
commit 517ebd1d3e
101 changed files with 681 additions and 509 deletions

View File

@@ -275,7 +275,7 @@ public class MethodMessageHandlerTests {
private static Map<Class<? extends Throwable>, Method> initExceptionMappings(Class<?> handlerType) {
Map<Class<? extends Throwable>, Method> result = new HashMap<Class<? extends Throwable>, Method>();
for (Method method : MethodIntrospector.selectMethods(handlerType, EXCEPTION_HANDLER_METHOD_FILTER)) {
for(Class<? extends Throwable> exception : getExceptionsFromMethodSignature(method)) {
for (Class<? extends Throwable> exception : getExceptionsFromMethodSignature(method)) {
result.put(exception, method);
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@@ -13,10 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.messaging.simp.stomp;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
package org.springframework.messaging.simp.stomp;
import java.lang.reflect.Type;
import java.util.ArrayList;
@@ -41,6 +39,9 @@ import org.springframework.util.Assert;
import org.springframework.util.SocketUtils;
import org.springframework.util.concurrent.ListenableFuture;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
* Integration tests for {@link Reactor2TcpStompClient}.
*
@@ -86,7 +87,8 @@ public class Reactor2TcpStompClientTests {
public void tearDown() throws Exception {
try {
this.client.shutdown();
} catch (Throwable ex) {
}
catch (Throwable ex) {
logger.error("Failed to shut client", ex);
}
final CountDownLatch latch = new CountDownLatch(1);
@@ -100,7 +102,6 @@ public class Reactor2TcpStompClientTests {
@Test
public void publishSubscribe() throws Exception {
String destination = "/topic/foo";
ConsumingHandler consumingHandler1 = new ConsumingHandler(destination);
ListenableFuture<StompSession> consumerFuture1 = this.client.connect(consumingHandler1);
@@ -146,9 +147,9 @@ public class Reactor2TcpStompClientTests {
public void handleTransportError(StompSession session, Throwable exception) {
logger.error(exception);
}
}
private static class ConsumingHandler extends LoggingSessionHandler {
private final List<String> topics;
@@ -157,14 +158,12 @@ public class Reactor2TcpStompClientTests {
private final List<String> received = new ArrayList<>();
public ConsumingHandler(String... topics) {
Assert.notEmpty(topics);
this.topics = Arrays.asList(topics);
this.subscriptionLatch = new CountDownLatch(this.topics.size());
}
public List<String> getReceived() {
return this.received;
}
@@ -208,16 +207,15 @@ public class Reactor2TcpStompClientTests {
}
return true;
}
}
private static class ProducingHandler extends LoggingSessionHandler {
private final List<String> topics = new ArrayList<>();
private final List<Object> payloads = new ArrayList<>();
public ProducingHandler addToSend(String topic, Object payload) {
this.topics.add(topic);
this.payloads.add(payload);
@@ -226,7 +224,7 @@ public class Reactor2TcpStompClientTests {
@Override
public void afterConnected(StompSession session, StompHeaders connectedHeaders) {
for (int i=0; i < this.topics.size(); i++) {
for (int i = 0; i < this.topics.size(); i++) {
session.send(this.topics.get(i), this.payloads.get(i));
}
}

View File

@@ -326,7 +326,7 @@ public class StompBrokerRelayMessageHandlerIntegrationTests {
}
public boolean matchMessage(Message<?> message) {
for (int i=0 ; i < this.expected.length; i++) {
for (int i = 0 ; i < this.expected.length; i++) {
if (this.expected[i].match(message)) {
this.actual[i] = message;
return true;

View File

@@ -325,7 +325,8 @@ public class StompCodecTests {
this.decoder.apply(buffer);
if (consumer.arguments.isEmpty()) {
return null;
} else {
}
else {
return consumer.arguments.get(0);
}
}