Skip to content

Commit

Permalink
Refine null-safety in spring-jms
Browse files Browse the repository at this point in the history
  • Loading branch information
sdeleuze committed Mar 25, 2024
1 parent a63ebe7 commit 06b91c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.lang.Nullable;
import org.springframework.util.StringUtils;

/**
Expand Down Expand Up @@ -56,6 +57,7 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {


@Override
@Nullable
protected RootBeanDefinition createContainerFactory(String factoryId, Element containerEle, ParserContext parserContext,
PropertyValues commonContainerProperties, PropertyValues specificContainerProperties) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public void resetConnection() {
* Checks for a cached Session for the given mode.
*/
@Override
@Nullable
protected Session getSession(Connection con, Integer mode) throws JMSException {
if (!this.active) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ public static void rollbackIfNecessary(Session session) throws JMSException {
* @return the descriptive message String
* @see jakarta.jms.JMSException#getLinkedException()
*/
@Nullable
public static String buildExceptionMessage(JMSException ex) {
String message = ex.getMessage();
Exception linkedEx = ex.getLinkedException();
Expand Down

0 comments on commit 06b91c4

Please sign in to comment.