MessageBuilder#createMessage should not define the payload as @Nullable #31610
Labels
in: messaging
Issues in messaging modules (jms, messaging)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
The
MessageBuilder#createMessage
method has thepayload
attribute set as@Nullable
, but the javadoc and assertions for the method make it clear that passingnull
as payload is not allowed.If I understand correctly these annotations were added to make the support for Kotlin and
null
handling work, but this makes Kotlin expect it to be nullable, which goes against the docs and assertions.So unless I'm missing something this is a bug and the
@Nullable
annotation should be removed here?spring-framework/spring-messaging/src/main/java/org/springframework/messaging/support/MessageBuilder.java
Line 204 in a12c9a0
The text was updated successfully, but these errors were encountered: