Refine null-safety in spring-jms

See gh-32475
This commit is contained in:
Sébastien Deleuze 2024-03-25 11:28:00 +01:00
parent a63ebe7e9d
commit 06b91c4ea5
3 changed files with 4 additions and 0 deletions

View File

@ -24,6 +24,7 @@ import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ParserContext; import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
/** /**
@ -56,6 +57,7 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
@Override @Override
@Nullable
protected RootBeanDefinition createContainerFactory(String factoryId, Element containerEle, ParserContext parserContext, protected RootBeanDefinition createContainerFactory(String factoryId, Element containerEle, ParserContext parserContext,
PropertyValues commonContainerProperties, PropertyValues specificContainerProperties) { PropertyValues commonContainerProperties, PropertyValues specificContainerProperties) {

View File

@ -240,6 +240,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
* Checks for a cached Session for the given mode. * Checks for a cached Session for the given mode.
*/ */
@Override @Override
@Nullable
protected Session getSession(Connection con, Integer mode) throws JMSException { protected Session getSession(Connection con, Integer mode) throws JMSException {
if (!this.active) { if (!this.active) {
return null; return null;

View File

@ -244,6 +244,7 @@ public abstract class JmsUtils {
* @return the descriptive message String * @return the descriptive message String
* @see jakarta.jms.JMSException#getLinkedException() * @see jakarta.jms.JMSException#getLinkedException()
*/ */
@Nullable
public static String buildExceptionMessage(JMSException ex) { public static String buildExceptionMessage(JMSException ex) {
String message = ex.getMessage(); String message = ex.getMessage();
Exception linkedEx = ex.getLinkedException(); Exception linkedEx = ex.getLinkedException();