Browse Source

Fix wrong nullability requirement

Closes gh-31610
6.0.x
Stéphane Nicoll 1 year ago
parent
commit
df6f66110f
  1. 2
      spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java

2
spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java

@ -201,7 +201,7 @@ public final class MessageBuilder<T> {
* @since 4.1 * @since 4.1
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public static <T> Message<T> createMessage(@Nullable T payload, MessageHeaders messageHeaders) { public static <T> Message<T> createMessage(T payload, MessageHeaders messageHeaders) {
Assert.notNull(payload, "Payload must not be null"); Assert.notNull(payload, "Payload must not be null");
Assert.notNull(messageHeaders, "MessageHeaders must not be null"); Assert.notNull(messageHeaders, "MessageHeaders must not be null");
if (payload instanceof Throwable throwable) { if (payload instanceof Throwable throwable) {

Loading…
Cancel
Save