From 133f330850aa91b0628f372e315c9e396a4e4543 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Fri, 4 Jul 2025 11:35:49 +0200 Subject: [PATCH] =?UTF-8?q?Declare=20remaining=20messageSelector=20paramet?= =?UTF-8?q?ers=20in=20JmsOperations=20as=20@=E2=81=A0Nullable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes gh-35151 --- .../springframework/jms/core/JmsOperations.java | 12 ++++++------ .../springframework/jms/core/JmsTemplate.java | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java b/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java index 5eb92ef25f7..5e9af5e83ae 100644 --- a/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java +++ b/spring-jms/src/main/java/org/springframework/jms/core/JmsOperations.java @@ -336,7 +336,7 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - Object receiveSelectedAndConvert(String messageSelector) throws JmsException; + Object receiveSelectedAndConvert(@Nullable String messageSelector) throws JmsException; /** * Receive a message synchronously from the specified destination, but only @@ -351,7 +351,7 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - Object receiveSelectedAndConvert(Destination destination, String messageSelector) throws JmsException; + Object receiveSelectedAndConvert(Destination destination, @Nullable String messageSelector) throws JmsException; /** * Receive a message synchronously from the specified destination, but only @@ -367,7 +367,7 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - Object receiveSelectedAndConvert(String destinationName, String messageSelector) throws JmsException; + Object receiveSelectedAndConvert(String destinationName, @Nullable String messageSelector) throws JmsException; //--------------------------------------------------------------------------------------- @@ -468,7 +468,7 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - T browseSelected(String messageSelector, BrowserCallback action) throws JmsException; + T browseSelected(@Nullable String messageSelector, BrowserCallback action) throws JmsException; /** * Browse selected messages in a JMS queue. The callback gives access to the JMS @@ -481,7 +481,7 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - T browseSelected(Queue queue, String messageSelector, BrowserCallback action) throws JmsException; + T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback action) throws JmsException; /** * Browse selected messages in a JMS queue. The callback gives access to the JMS @@ -495,6 +495,6 @@ public interface JmsOperations { * @throws JmsException checked JMSException converted to unchecked */ @Nullable - T browseSelected(String queueName, String messageSelector, BrowserCallback action) throws JmsException; + T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback action) throws JmsException; } diff --git a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java index 747e362a53b..b8f30777add 100644 --- a/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java +++ b/spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java @@ -763,13 +763,13 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable - public Message receiveSelected(final Destination destination, @Nullable final String messageSelector) throws JmsException { + public Message receiveSelected(Destination destination, @Nullable String messageSelector) throws JmsException { return execute(session -> doReceive(session, destination, messageSelector), true); } @Override @Nullable - public Message receiveSelected(final String destinationName, @Nullable final String messageSelector) throws JmsException { + public Message receiveSelected(String destinationName, @Nullable String messageSelector) throws JmsException { return execute(session -> { Destination destination = resolveDestinationName(session, destinationName); return doReceive(session, destination, messageSelector); @@ -857,19 +857,19 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable - public Object receiveSelectedAndConvert(String messageSelector) throws JmsException { + public Object receiveSelectedAndConvert(@Nullable String messageSelector) throws JmsException { return doConvertFromMessage(receiveSelected(messageSelector)); } @Override @Nullable - public Object receiveSelectedAndConvert(Destination destination, String messageSelector) throws JmsException { + public Object receiveSelectedAndConvert(Destination destination, @Nullable String messageSelector) throws JmsException { return doConvertFromMessage(receiveSelected(destination, messageSelector)); } @Override @Nullable - public Object receiveSelectedAndConvert(String destinationName, String messageSelector) throws JmsException { + public Object receiveSelectedAndConvert(String destinationName, @Nullable String messageSelector) throws JmsException { return doConvertFromMessage(receiveSelected(destinationName, messageSelector)); } @@ -1022,7 +1022,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable - public T browseSelected(String messageSelector, BrowserCallback action) throws JmsException { + public T browseSelected(@Nullable String messageSelector, BrowserCallback action) throws JmsException { Queue defaultQueue = getDefaultQueue(); if (defaultQueue != null) { return browseSelected(defaultQueue, messageSelector, action); @@ -1034,7 +1034,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable - public T browseSelected(final Queue queue, @Nullable final String messageSelector, final BrowserCallback action) + public T browseSelected(Queue queue, @Nullable String messageSelector, BrowserCallback action) throws JmsException { Assert.notNull(action, "Callback object must not be null"); @@ -1051,7 +1051,7 @@ public class JmsTemplate extends JmsDestinationAccessor implements JmsOperations @Override @Nullable - public T browseSelected(final String queueName, @Nullable final String messageSelector, final BrowserCallback action) + public T browseSelected(String queueName, @Nullable String messageSelector, BrowserCallback action) throws JmsException { Assert.notNull(action, "Callback object must not be null");