Use the diamond syntax

Closes gh-1450
This commit is contained in:
diguage
2017-06-05 19:20:22 +08:00
committed by Stephane Nicoll
parent ca1e682dc4
commit c1d44d9a34
16 changed files with 23 additions and 24 deletions

View File

@@ -424,7 +424,7 @@ public abstract class AbstractMethodMessageHandler<T>
}
protected void handleMessageInternal(Message<?> message, String lookupDestination) {
List<Match> matches = new ArrayList<Match>();
List<Match> matches = new ArrayList<>();
List<T> mappingsByUrl = this.destinationLookup.get(lookupDestination);
if (mappingsByUrl != null) {

View File

@@ -51,7 +51,7 @@ public class BufferingStompDecoder {
private final int bufferSizeLimit;
private final Queue<ByteBuffer> chunks = new LinkedBlockingQueue<ByteBuffer>();
private final Queue<ByteBuffer> chunks = new LinkedBlockingQueue<>();
private volatile Integer expectedContentLength;
@@ -107,7 +107,7 @@ public class BufferingStompDecoder {
}
ByteBuffer bufferToDecode = assembleChunksAndReset();
MultiValueMap<String, String> headers = new LinkedMultiValueMap<String, String>();
MultiValueMap<String, String> headers = new LinkedMultiValueMap<>();
List<Message<byte[]>> messages = this.stompDecoder.decode(bufferToDecode, headers);
if (bufferToDecode.hasRemaining()) {

View File

@@ -53,7 +53,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receive() {
Message<?> expected = new GenericMessage<Object>("payload");
Message<?> expected = new GenericMessage<>("payload");
this.template.setDefaultDestination("home");
this.template.setReceiveMessage(expected);
Message<?> actual = this.template.receive();
@@ -69,7 +69,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receiveFromDestination() {
Message<?> expected = new GenericMessage<Object>("payload");
Message<?> expected = new GenericMessage<>("payload");
this.template.setReceiveMessage(expected);
Message<?> actual = this.template.receive("somewhere");
@@ -79,7 +79,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receiveAndConvert() {
Message<?> expected = new GenericMessage<Object>("payload");
Message<?> expected = new GenericMessage<>("payload");
this.template.setDefaultDestination("home");
this.template.setReceiveMessage(expected);
String payload = this.template.receiveAndConvert(String.class);
@@ -90,7 +90,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receiveAndConvertFromDestination() {
Message<?> expected = new GenericMessage<Object>("payload");
Message<?> expected = new GenericMessage<>("payload");
this.template.setReceiveMessage(expected);
String payload = this.template.receiveAndConvert("somewhere", String.class);
@@ -100,7 +100,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receiveAndConvertFailed() {
Message<?> expected = new GenericMessage<Object>("not a number test");
Message<?> expected = new GenericMessage<>("not a number test");
this.template.setReceiveMessage(expected);
this.template.setMessageConverter(new GenericMessageConverter());
@@ -111,7 +111,7 @@ public class MessageReceivingTemplateTests {
@Test
public void receiveAndConvertNoConverter() {
Message<?> expected = new GenericMessage<Object>("payload");
Message<?> expected = new GenericMessage<>("payload");
this.template.setDefaultDestination("home");
this.template.setReceiveMessage(expected);
this.template.setMessageConverter(new GenericMessageConverter());