Skip to content

Commit 06b91c4

Browse files
committed
Refine null-safety in spring-jms
See spring-projectsgh-32475
1 parent a63ebe7 commit 06b91c4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

spring-jms/src/main/java/org/springframework/jms/config/JmsListenerContainerParser.java

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.beans.factory.config.RuntimeBeanReference;
2525
import org.springframework.beans.factory.support.RootBeanDefinition;
2626
import org.springframework.beans.factory.xml.ParserContext;
27+
import org.springframework.lang.Nullable;
2728
import org.springframework.util.StringUtils;
2829

2930
/**
@@ -56,6 +57,7 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
5657

5758

5859
@Override
60+
@Nullable
5961
protected RootBeanDefinition createContainerFactory(String factoryId, Element containerEle, ParserContext parserContext,
6062
PropertyValues commonContainerProperties, PropertyValues specificContainerProperties) {
6163

spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

+1
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ public void resetConnection() {
240240
* Checks for a cached Session for the given mode.
241241
*/
242242
@Override
243+
@Nullable
243244
protected Session getSession(Connection con, Integer mode) throws JMSException {
244245
if (!this.active) {
245246
return null;

spring-jms/src/main/java/org/springframework/jms/support/JmsUtils.java

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ public static void rollbackIfNecessary(Session session) throws JMSException {
244244
* @return the descriptive message String
245245
* @see jakarta.jms.JMSException#getLinkedException()
246246
*/
247+
@Nullable
247248
public static String buildExceptionMessage(JMSException ex) {
248249
String message = ex.getMessage();
249250
Exception linkedEx = ex.getLinkedException();

0 commit comments

Comments
 (0)