From 360caf3d9737dd24a2864b71da12656ba22737ae Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 29 Feb 2016 19:24:18 +0100 Subject: [PATCH] Polish --- .../boot/autoconfigure/jms/JmsAutoConfiguration.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java index 555baeaf60..72d5f5eaac 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/JmsAutoConfiguration.java @@ -63,11 +63,13 @@ public class JmsAutoConfiguration { public JmsTemplate jmsTemplate() { JmsTemplate jmsTemplate = new JmsTemplate(this.connectionFactory); jmsTemplate.setPubSubDomain(this.properties.isPubSubDomain()); - if (this.destinationResolver != null) { - jmsTemplate.setDestinationResolver(this.destinationResolver.getIfUnique()); + DestinationResolver destinationResolver = this.destinationResolver.getIfUnique(); + if (destinationResolver != null) { + jmsTemplate.setDestinationResolver(destinationResolver); } - if (this.messageConverter != null) { - jmsTemplate.setMessageConverter(this.messageConverter.getIfUnique()); + MessageConverter messageConverter = this.messageConverter.getIfUnique(); + if (messageConverter != null) { + jmsTemplate.setMessageConverter(messageConverter); } return jmsTemplate; }