INT-4221: Properly use Spring's Assert class

JIRA: https://jira.spring.io/browse/INT-4221

* Upgrade to those versions of Spring project dependencies which potentially will provide similar fix

**Cherry-pick to 4.3.x**
This commit is contained in:
Artem Bilan
2017-01-30 22:27:59 -05:00
parent 63e715a685
commit a4bfd2cc42
42 changed files with 170 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -38,6 +38,7 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* Message Mapper for converting to and from UDP DatagramPackets. When
@@ -149,7 +150,7 @@ public class DatagramPacketMessageMapper implements InboundMessageMapper<Datagra
* Prefix raw byte[] from message with 'acknowledge to' and 'message id' "headers".
*/
private DatagramPacket fromMessageWithAck(Message<?> message) throws Exception {
Assert.hasLength(this.ackAddress);
Assert.state(StringUtils.hasText(this.ackAddress), "'ackAddress' must not be empty");
byte[] bytes = getPayloadAsBytes(message);
ByteBuffer buffer = ByteBuffer.allocate(100 + bytes.length);
if (this.lengthCheck) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2001-2016 the original author or authors.
* Copyright 2001-2017 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.
@@ -44,6 +44,7 @@ import org.springframework.messaging.MessageDeliveryException;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.messaging.MessagingException;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* A {@link org.springframework.messaging.MessageHandler} implementation that maps a Message into
@@ -213,7 +214,7 @@ public class UnicastSendingMessageHandler extends
}
this.acknowledge = acknowledge;
if (this.acknowledge) {
Assert.hasLength(ackHost);
Assert.state(StringUtils.hasText(ackHost), "'ackHost' must not be empty");
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2016 the original author or authors.
* Copyright 2015-2017 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.
@@ -47,7 +47,7 @@ public class MulticastRule extends TestWatcher {
}
public MulticastRule(String group) {
Assert.hasText(group);
Assert.hasText(group, "'group' must not be empty");
this.group = group;
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("multicast.group", this.group);