mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
TextMessage.getText() and ObjectMessage.getObject() may both return null per the JMS specification when the message body was never set, but SimpleMessageConverter.fromMessage() and its parent MessageConverter interface currently declare a non-null return type despite residing in an @NullMarked package. To address that, this commit updates MessageConverter.fromMessage(), SimpleMessageConverter, and the protected extractStringFromMessage()/extractSerializableFromMessage() methods to declare @Nullable accordingly and propagate the resulting nullability through MessagingMessageConverter and AbstractAdaptableMessageListener/MessageListenerAdapter, raising a clear MessageConversionException where a non-null payload is required by the Message<T> contract. Closes gh-37148