Browse Source

Declare messageSelector parameters in JmsOperations as @⁠Nullable

See gh-35151

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
pull/35405/head
Jiandong Ma 6 months ago committed by Sam Brannen
parent
commit
b6675edb92
  1. 6
      spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java
  2. 2
      spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java

6
spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java

@ -247,7 +247,7 @@ public interface JmsOperations {
* @throws JmsException checked JMSException converted to unchecked * @throws JmsException checked JMSException converted to unchecked
*/ */
@Nullable @Nullable
Message receiveSelected(String messageSelector) throws JmsException; Message receiveSelected(@Nullable String messageSelector) throws JmsException;
/** /**
* Receive a message synchronously from the specified destination, but only * Receive a message synchronously from the specified destination, but only
@ -261,7 +261,7 @@ public interface JmsOperations {
* @throws JmsException checked JMSException converted to unchecked * @throws JmsException checked JMSException converted to unchecked
*/ */
@Nullable @Nullable
Message receiveSelected(Destination destination, String messageSelector) throws JmsException; Message receiveSelected(Destination destination, @Nullable String messageSelector) throws JmsException;
/** /**
* Receive a message synchronously from the specified destination, but only * Receive a message synchronously from the specified destination, but only
@ -276,7 +276,7 @@ public interface JmsOperations {
* @throws JmsException checked JMSException converted to unchecked * @throws JmsException checked JMSException converted to unchecked
*/ */
@Nullable @Nullable
Message receiveSelected(String destinationName, String messageSelector) throws JmsException; Message receiveSelected(String destinationName, @Nullable String messageSelector) throws JmsException;
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------

2
spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java

@ -751,7 +751,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations
@Override @Override
@Nullable @Nullable
public Message receiveSelected(String messageSelector) throws JmsException { public Message receiveSelected(@Nullable String messageSelector) throws JmsException {
Destination defaultDestination = getDefaultDestination(); Destination defaultDestination = getDefaultDestination();
if (defaultDestination != null) { if (defaultDestination != null) {
return receiveSelected(defaultDestination, messageSelector); return receiveSelected(defaultDestination, messageSelector);

Loading…
Cancel
Save